handle failed page fetch
This commit is contained in:
@@ -202,6 +202,10 @@ class RentalCrawler {
|
||||
const body = await adPageSource.text();
|
||||
const $ = cheerio.load(body);
|
||||
|
||||
if (body.indexOf('<html') === -1) {
|
||||
throw { message: 'Failed to fetch page !' }
|
||||
}
|
||||
|
||||
const mapElementParent = $(".box-map").parent();
|
||||
const scriptElement = $("script", mapElementParent);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user