Skip to content

Seleniumbase CDP mode opening new tabs #3384

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

You must be logged in to vote

There's a CDP Mode example that uses multiple tabs:
SeleniumBase/examples/cdp_mode/raw_easyjet.py

First it calls sb.connect() so that WebDriver methods are available again:

Then it can cycle through tabs:

for window in sb.driver.window_handles:

And switch to the tab it wants:

sb.switch_to_window(window)

CDP Mode (while disconnected) isn't very good at handling multiple tabs because it's mainly for interacting with things inside a w…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ZcodeZ777
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