Fixed crawler not reading and comparing all RERequest results
This commit is contained in:
@@ -36,10 +36,13 @@ module.exports = class OlxCrawler {
|
||||
const urls = this.createRequestUrls(realestateRequests);
|
||||
let results = await this.indexPages(urls, this.fromPage, this.toPage, this.maxResults);
|
||||
console.log("Final crawler results");
|
||||
if (results[0]) {
|
||||
console.log(results[0].length);
|
||||
// console.log(results);
|
||||
const flatResults = results.flat();
|
||||
console.log(flatResults);
|
||||
if (flatResults) {
|
||||
console.log(flatResults.length);
|
||||
|
||||
for (const finalResult of results[0]) {
|
||||
for (const finalResult of flatResults) {
|
||||
|
||||
if (null !== finalResult) {
|
||||
if (finalResult.lat !== undefined && finalResult.lat !== null && finalResult.lat !== "") {
|
||||
|
||||
Reference in New Issue
Block a user