I'm trying to grab the text of whatever the captcha is wanting you to solve for. So for example, if the captcha is asking for you to select all the "Cars" then I want to select that value with Beautifulsoup (or another library).
https://www.google.com/recaptcha/api2/demo is the website I'm referencing.
Captcha Picture So for this one, I want to grab the following line:
<strong style="font-size: 22px;">cars</strong>
I cannot figure this one out.
This is my current version of code:
driver = webdriver.Chrome(path)
captcha_url = 'https://www.google.com/recaptcha/api2/demo'
driver.get(captcha_url)
xpath_captch = '//*[@id="recaptcha-demo"]/div/div/iframe'
wait = WebDriverWait(driver, 20)
time.sleep(3)
driver.find_element(By.XPATH, xpath_captch).click()
time.sleep(5)
soup = BeautifulSoup(driver.page_source, "html.parser")
divs = soup.find_all('div')
source https://stackoverflow.com/questions/75814933/grabbing-recaptcha-text-via-beautifulsoup
Comments
Post a Comment