How to manage browser tabs
Example from Selenium get num tabs - driver.window_handles switch to tab - driver.switch_to.window(tab hash)
Please write how to do it in botasaurus?
I found it. See cdp target. driver.run_cdp_command(cdp.target.get_targets()) return quantity of tabs
Did you find any way to switch to a popup window ?
Popup is an iframe or div block.
It is a seperate browser window, the one's you get when you click on a sign in button for Google or Microsoft account.
I have found this solution for now driver.switch_to_tab(driver._browser.tabs[1])
For some reason - None of the solutions are working
Tried:
driver.switch_to_tab(driver._browser.tabs[1])
Finally found working solutions
First we can get list of tabs
driver._browser.tabs[-1]
Next, to select that tab
driver._tab = driver._browser.tabs[-1]
This won't do anything on scene but It'll select in code context.
Next do any action of that tab Eg. close it
driver._tab.close()
you can use methods like open_link_in_new_tab, switch_to_tab, to manage tab, also every get function like get, get_via_google returns a tab.