Skip to content

Commit

Permalink
Fix missing PuppeteerPool in handlePageFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
mnmkng committed Jan 9, 2021
1 parent 6782d5a commit 0a17190
Show file tree
Hide file tree
Showing 3 changed files with 6 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.22.3 / 2021/01/09
====================
- Fix `puppeteerPool` missing in handle page arguments.

0.22.2 / 2020/12/22
====================
- Pinned `cheerio` to `1.0.0-rc.3` to avoid install problems in some builds.
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.22.2",
"version": "0.22.3",
"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"
Expand Down
2 changes: 1 addition & 1 deletion src/crawlers/puppeteer_crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ class PuppeteerCrawler extends BasicCrawler {
*/
async _handleRequestFunction(crawlingContext) {
crawlingContext.page = await this.puppeteerPool.newPage();
crawlingContext.puppeteerPool = this.puppeteerPool;

const { page, request } = crawlingContext;
// eslint-disable-next-line no-underscore-dangle
Expand Down Expand Up @@ -375,7 +376,6 @@ class PuppeteerCrawler extends BasicCrawler {
}

crawlingContext.response = response;
crawlingContext.puppeteerPool = this.puppeteerPool;

await addTimeoutToPromise(
this.userProvidedHandler(crawlingContext),
Expand Down

0 comments on commit 0a17190

Please sign in to comment.