📜  selenium python代码示例中的超时异常

📅  最后修改于: 2022-03-11 14:45:40.510000             🧑  作者: Mango

代码示例1
from selenium import webdriver
from selenium.common.exceptions import TimeoutException

Driver = webdriver.Firefox()
try:
    Driver.set_page_load_timeout(1)
    Driver.get("http://www.engadget.com")
except TimeoutException as ex:
    isrunning = 0
    print("Exception has been thrown. " + str(ex))
    Driver.close()