eastern-cyan
eastern-cyan15mo ago

TargetClosedError: Target page, context or browser has been closed (I've tried a lot)

Hello, I've tried a lot to resolve this issue, from changing memory, concurrency, to requests per minute - I can't seem to understand why this randomly happens. I can't tell if I'm missing an await anywhere. More importantly, I'm not sure how to access context with currently crawlee lib, ie: https://docs.apify.com/academy/node-js/how_to_fix_target-closed Any guidance would be most helpful. My concern is we're already looking to offload our crawlers to the Apify platform (already testing), so we want to make this work first in our own environment. Currently on "crawlee": "3.9.2" Code for reference attached.
4 Replies
Alexey Udovydchenko
Hi! Please upgrade to crawlee 3.9.3 then add more logs to find out when exactly page closed, i.e. might be inside "while (!isEndReached)" loop.
eastern-cyan
eastern-cyanOP15mo ago
ok thanks, I'll try this
Oleg V.
Oleg V.14mo ago
I guess, it's better to upgrade to crawlee's latest (3.10) version. AFAIK, it's some bug related to old versions. Always use / update to latest, if You can)
eastern-cyan
eastern-cyanOP14mo ago
thanks

Did you find this page helpful?