data-sitekey通过41个字符的字符串表示的效果很好。
ERROR_WRONG_USER_KEY发生错误是因为我一开始从未准备好有效的API密钥。即使您的帐户中的余额
为零 ,您也可以按以下方式成功获得
<Response [200]>带有的文本
ERROR_ZERO_BALANCE:
代码块:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import requestsoptions = webdriver.ChromeOptions()
options.add_argument(“start-maximized”)
options.add_experimental_option(“excludeSwitches”, [“enable-automation”])
options.add_experimental_option(‘useAutomationExtension’, False)
driver = webdriver.Chrome(options=options, executable_path=r’C:WebDriverschromedriver.exe’)
mainurl = ‘https://imagetyperz.xyz/automation/recaptcha-v2.html'
driver.get(mainurl)
data_sitekey = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CLASS_NAME, “g-recaptcha”))).get_attribute(“data-sitekey”)
print(data_sitekey)
api_key = ‘--------------------------------‘
data_post = {‘key’: api_key, ‘method’: ‘userrecaptcha’, ‘googlekey’: data_sitekey, “pageurl”: mainurl}
response = requests.post(url = 'https://2captcha.com/in.php’, data = data_post )
print(response)
print(response.text)控制台输出:
6LdXeIYUAAAAAFmFKJ6Cl3zo4epRZ0LDdOrYsvRY
ERROR_ZERO_BALANCE
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)