extended-salmon
extended-salmon10mo ago

How to close Puppeteer browser mid-run while continuing actor execution in crawlee?

Hi everyone, I’m using PuppeteerCrawler for scraping because it unblocks websites effectively and allows JavaScript execution. However, I’m facing an issue: After accessing a website, I extract the required data from network requests (e.g., HTML) and parse it later with cheerio. At this point, I no longer need the browser, but I still want the Actor to continue running in the background to process and format the extracted data. Is there a way to close the Puppeteer browser mid-run to free up resources while keeping the Actor alive to handle the data? Any guidance or examples would be greatly appreciated! Thanks!
4 Replies
Hall
Hall10mo ago
Someone will reply to you shortly. In the meantime, this might help:
Exp
Exp10mo ago
Hi first, using await page.browser().close() explicitly closes the Puppeteer browser instance.
extended-salmon
extended-salmonOP10mo ago
@Exp Hi, that's it? Nothing else? it won't affect Actor in any way?
Exp
Exp10mo ago
The script can continues executing further processing after the browser is closed.

Did you find this page helpful?