📜  如果超时,重新加载硒 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:22.358000             🧑  作者: Mango

代码示例1
retries = 1
while retries <= 5:
    try:
        quote = wait.until(EC.element_to_be_clickable((By.XPATH, '//h4[@class="quote-number ng-binding"]'))).text.split("#")[1]
        break
    except TimeoutException:
        driver.refresh()
        retries += 1