0

Is there any method in Python + Selenium for retrieving the webdriver's current page load timeout?

I know to use set_page_load_timeout() and examining the Chromedriver logs shows that this modified its internal state so I am wondering if there's way to query for it?

Alternatively, I will simply save the value on my side of the code. The retrieval would be helpful to verify that the timeout was successfully set and later on that it's still the same.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Neil C. Obremski
  • 18,696
  • 24
  • 83
  • 112
  • 1
    There's no reason to believe that if you set it properly that it wouldn't be set and stay the same unless you set it otherwise. – JeffC Dec 28 '18 at 18:02

1 Answers1

2

When you initialize the WebDriver it is configured with a default page_load_timeout of 300000 seconds which you can extract from the capabilities dictionary as follows:

  • Code Block:

    from selenium import webdriver
    
    driver = webdriver.Firefox(executable_path=r'C:\Utility\BrowserDrivers\geckodriver.exe')
    dict = driver.capabilities['timeouts']
    print(dict["pageLoad"])
    driver.quit()
    
  • Console Output:

    300000
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352