如何使用 Selenium 和 Python 与 reCAPTCHA 音频元素交互 [英] How to interact with the reCAPTCHA audio element using Selenium and Python

查看:37
本文介绍了如何使用 Selenium 和 Python 与 reCAPTCHA 音频元素交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,点击按钮通过音频解析验证码,但是selenium没有检测到指定的id".

browser.get("https://www.google.com/recaptcha/api2/demo")mainWin = browser.current_window_handleiframe = browser.find_elements_by_tag_name("iframe")[0]browser.switch_to_frame(iframe)CheckBox = WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.ID ,"recaptcha-anchor"))).click()睡觉(4)audio = WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.ID,"recaptcha-audio-button"))).click()

解决方案

To click() 在按钮上通过音频解析验证码,因为所需的元素在