-
I am currently writing a python program which uses a seleniumbase web bot with CDP mode activated:
I need to be able to create new tab and switch between the new and original tab. I have read the docs but have not seen a solution to this in CDP mode, does anybody know how this can be done? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There's a CDP Mode example that uses multiple tabs: First it calls Then it can cycle through tabs: And switch to the tab it wants: CDP Mode (while disconnected) isn't very good at handling multiple tabs because it's mainly for interacting with things inside a web page, but not outside (like the tabs). Call You can also use |
Beta Was this translation helpful? Give feedback.
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:SeleniumBase/examples/cdp_mode/raw_easyjet.py
Line 29 in 11e81b0
Then it can cycle through tabs:
SeleniumBase/examples/cdp_mode/raw_easyjet.py
Line 31 in 11e81b0
And switch to the tab it wants:
SeleniumBase/examples/cdp_mode/raw_easyjet.py
Line 32 in 11e81b0
CDP Mode (while disconnected) isn't very good at handling multiple tabs because it's mainly for interacting with things inside a w…