Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proper way to clean-up when using cdp driver mode? #3768

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

I've always used the SB context manager in the past, but on my current project I found the standalone driver more convenient i.e.

sb = sb_cdp.Chrome(url, lang="en")

However, I'm unsure how to close the cdp connection and quit the browser in the same way the context manager does after the yield. I've seen other discussions mention using sb.driver.quit(), but this method doesn't appear to be available for the Chrome instance. Looking at the code it seems that sb.driver.stop() could be the equivalent?

Thanks!

You must be logged in to vote

I would use sb.driver.stop(), as that will quit the browser, and should free up resources used.

Replies: 2 comments

Comment options

I would use sb.driver.stop(), as that will quit the browser, and should free up resources used.

You must be logged in to vote
0 replies
Answer selected by mdmintz
Comment options

Any method for from seleniumbase import Driver mode?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /