Dealing with reCAPTCHA in Python Selenium

后端 未结 3 1167
离开以前
离开以前 2021-01-23 08:48

I need to automate a web page using python selenium, but it encounters a reCaptcha, which is in another frame. I want to solve the captcha, and continue the script by clicking t

3条回答
  •  爱一瞬间的悲伤
    2021-01-23 09:04

    You can simply wait for the checkbox to show the done icon and then the wait will be over

    Like in the code below

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    
    driver = webdriver.Firefox()
    driver.get("http://somedomain/url_that_delays_loading")
    try:
        element = WebDriverWait(driver, 100).until(
            EC.presence_of_element_located((By.ID, "myDynamicElement"))
        )
    finally:
        driver.quit() here
    

提交回复
热议问题