Skip to content Skip to sidebar Skip to footer

How To Loop Through Multiple Chrome Browser Tabs With Selenium And Python?

I'm using Selenium Web Driver and Python. How would I loop through multiple open Chrome browser tabs and stay on each page for 30 seconds, then loop back to the first URL and go th

Solution 1:

Open all tabs in once, Then you should count the tabs you have. Then loop on each on:

 cnt = len(driver.window_handles)
 for x in range(cnt):
     driver.switch_to.window(driver.window_handles[x])
     sleep(30) #30sec

Post a Comment for "How To Loop Through Multiple Chrome Browser Tabs With Selenium And Python?"