2

am trying to open multiple windows of the same URL using selenium, I used a for loop to open the multiple windows:

for i in range(x):
    driver = web driver.Chrome(executable_path="path")
    driver.get('testing')

but the problem is that the for loop wait until each element to open and load and when it finish automating the website and then it opens the next window. I want all of the windows open simultaneously and execute simultaneously to shorten the time needed, thank you in advance.

Taha Daboussi
  • 350
  • 3
  • 14

1 Answers1

1

Try using Selenium 4 currently in Alpha only https://pypi.org/project/selenium/4.0.0.a7/

It provides the following for opening new windows and tabs:

# Opens a new tab and switches to new tab
driver.switch_to.new_window('tab')

# Opens a new window and switches to new window
driver.switch_to.new_window('window')
WMRamadan
  • 974
  • 1
  • 11
  • 25