Execution context was destroyed, most likely because of a navigation - Error When Clicking Button #927
Oskarowski
started this conversation in
Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm encountering an issue when trying to use the
->click()
method in Browsershot to dismiss the consent modal on music.youtube.com. My goal is to click the "Reject all" button and then capture the page’s HTML. However, when I run the following PHP code:Here’s a PHP snippet of my code:
The page navigates after clicking the button, which destroys the execution context before the HTML is captured.
For comparison, in a JavaScript environment I handled this by explicitly waiting for the selector and navigation:
Is there a way to achieve similar behavior waitForNavigation in Browsershot? For example, could we delay the HTML capture until after the navigation is complete, or is there another workaround to ensure that the page's state is stable before calling bodyHtml()?
Any help or guidance would be greatly appreciated. Thanks for your time and for maintaining Browsershot!
Beta Was this translation helpful? Give feedback.
All reactions