Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Python Capmonster解决CAPTCHA_Python_Selenium_Selenium Webdriver_Selenium Chromedriver_Recaptcha - Fatal编程技术网

如何使用Python Capmonster解决CAPTCHA

如何使用Python Capmonster解决CAPTCHA,python,selenium,selenium-webdriver,selenium-chromedriver,recaptcha,Python,Selenium,Selenium Webdriver,Selenium Chromedriver,Recaptcha,我正在使用Python selenium chromedriver,我想将Capmonster添加到我的代码中。基本上,如果我的代码得到URL,就会出现一个ReCaptcha,我想解决它 我的代码 from threading import Thread from selenium.webdriver.chrome.options import Options from selenium import webdriver from selenium.webdriver.common.keys i

我正在使用Python selenium chromedriver,我想将Capmonster添加到我的代码中。基本上,如果我的代码得到URL,就会出现一个ReCaptcha,我想解决它

我的代码

from threading import Thread
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
import os


chromedriver = 'C:\\Users\\yvesb\\OneDrive\\Desktop\\chromedriver\\chromedriver.exe'
options = webdriver.ChromeOptions()
options.add_argument('headless')
options.add_argument('window-size=1200x600') # optional
driver = webdriver.Chrome(executable_path=chromedriver, chrome_options=options)


def test(driver, url):
    driver.get(url)
    try:
        driver.save_screenshot('C:\\Users\\yvesb\\Downloads\\headless_chrome_test7.png')
    finally:
        print("screenshot done")

url = "https://www.snipes.com/login"
Thread(target=test, args=(driver, url)).start()


当它得到URL时,会出现一个ReCaptcha,我想用我的Capmonster密钥来解决这个问题。

我建议您尝试一下我不久前开发的这个库。如果您有一套带标签的CAPTCHA,该服务将适合您。看一看:


在自述文件中,您可能会对“外部数据上的列车模型”一节感兴趣。

ReCaptcha的创建是为了防止机器人。如果您拥有该站点,请参阅如何在测试环境中绕过它。如果您没有,请停止尝试通过ReCaptcha。您可以查看此信息,也许它可以帮助您: