I want to open with selenium a website where you search for something in 5 different tabs. But when I run it it searching one by one. How can I do it at the same time?
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
PATH = 'C:\Program Files (x86)\chromedriver.exe'
driver = webdriver.Chrome(PATH)
for i in range(5):
driver.execute_script(f"window.open('about:blank', 'tab{i}');")
driver.switch_to.window(f"tab{i}")
driver.get('https://www.techwithtim.net/')
new = driver.find_element_by_class_name('search-field')
new.send_keys('Hi')
new.send_keys(Keys.RETURN)
What should I do?
Thanks.