Skip to content

Execution context was destroyed, most likely because of a navigation #2095

Closed Answered by barjin
teammakdi asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @teammakdi, it's actually because of the gotoOptions.waitUntil = 'domcontentloaded' line. By default, our crawlers wait until all the resources on the page are loaded (load event), so these exact errors don't happen. You crawler works just fine if you remove this line.

In case you want to save some bandwidth and time and not wait to load image, CSS, and font files, you can use the blockRequests context helper in the preNavigation hook like this:

preNavigationHooks: [
   async ({ blockRequests }) => await blockRequests(),
],

You can read more about this helper in our documentation.

Please let us know if this helped. Thank you!

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by teammakdi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working.
3 participants
Converted from issue

This discussion was converted from issue #2091 on September 25, 2023 09:17.