Skip to content

How to handle an unexpectedly closed browser? #3475

Answered by mdmintz
sebastianbrozda asked this question in Q&A
Discussion options

You must be logged in to vote

The browser wouldn't close unexpectedly in CDP Mode unless you manually closed it.

If you wanted to close the browser, you would first call sb.reconnect() and then sb.driver.quit().
But it's probably better to wait until the end of the with block for the automatic browser quit / close.

Also, you may want to use a Python breakpoint() instead of input() if you're just trying to pause the script.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sebastianbrozda
Comment options

@mdmintz
Comment options

@sebastianbrozda
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants