Skip to content

Commit

Permalink
Fix null response in PuppeteerCrawler
Browse files Browse the repository at this point in the history
  • Loading branch information
mnmkng committed Oct 3, 2020
1 parent 6527b30 commit ec6d66c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.21.7 / 2020/09/03
====================
- Fix an error in `PuppeteerCrawler` caused by `page.goto()` randomly returning `null`.

0.21.6 / 2020/09/02
====================
It appears that `CheerioCrawler` was correctly retiring sessions on timeouts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apify",
"version": "0.21.6",
"version": "0.21.7",
"description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
"engines": {
"node": "^10.17.0 || ^12.3.0"
Expand Down
5 changes: 4 additions & 1 deletion src/crawlers/puppeteer_crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ class PuppeteerCrawler {
}
}

if (this.useSessionPool) this._throwOnBlockedRequest(session, response.status());
if (this.useSessionPool) {
const statusCode = response && response.status();
this._throwOnBlockedRequest(session, statusCode);
}

await this.puppeteerPool.serveLiveViewSnapshot(page);
request.loadedUrl = page.url();
Expand Down

0 comments on commit ec6d66c

Please sign in to comment.