The error occurs when I do web scraping. with Selenium
Error Message :

WebDriverException: Message: unknown error: cannot determine loading 
status from no such execution context (Session info: chrome=73.0.3683.103)
  (Driver info: chromedriver=73.0.3683.68 
(47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7601 
SP1 x86_64)

When a new window is delayed, the following error occurs. I tried Googleing but I could not find a solution.

code:

    driver.switch_to.window(driver.window_handles[1])        
    WebDriverWait(driver,  
    60).until(EC.presence_of_element_located((By.CSS_SELECTOR,'#listForm > 
    div.contents_sub > div.cont_area > div > table.board_view.fix > tbody 
    > tr:nth-child(2) > td')))

How do I get this error?

2 Answers

0
Farrukh Dilawar On

I resolved the same problem. Try to print the no. of active windows to know whether second windows is present or not. Then switch to second window. In my case second windows was not active, so i added wait and then switched.

0
bertdida On

WebDriverWait doesn't work for me also, but using while and try except block works.

from selenium.common.exceptions import WebDriverException

...
driver.switch_to.window(driver.window_handles[1])

form = None
while form is None:
    try:
        form = driver.find_element_by_id('loginform')
    except WebDriverException:
        pass

print(form)

Additionally, I suggest trying geckodriver.