I have the latest version of the drivers (chromedriver=2.44.609551), selenium package(3.141.0) and the (headless chrome=70.0.3538.110). (on windows)
I am opening multiple windows with the browser. Using firefox, my script is always fast. But on chrome, after switching to a window (with the page already loaded), when I try to get anything from the browser (like driver.page_source or any find_element), I get a 4s-ish delay.
Am I doing something wrong?
[driver.execute_script('window.open(arguments[0]);', url) for url in urls]
for window in driver.window_handles[1:]:
driver.switch_to.window(window)
driver.page_source #it takes 4s here
driver.find_elements_by_class_name('class_name') #regular speed here (fast)
break
If i switch driver.page_source
with driver.find_elements_by_class_name('class_name')
, the first one will be always slow.