所以我正在使用这个 2captcha API 并在 omegle.com 之类的网站上对其进行测试。验证码解决发生了,但谷歌验证码框没有被勾选,什么也没有发生。想知道为什么会这样,我知道 2captcha API 运行得很好……但它只适用于 HTTP 请求而不适用于 selenium?
这是我插入到下面代码中的 API 链接:https : //github.com/2captcha/2captcha-api-examples/blob/master/ReCaptcha%20v2%20API%20Examples/Python%20Example/2captcha_python_api_example.py
from selenium import webdriver
from time import sleep
from selenium.common.exceptions import InvalidElementStateException
from selenium.common.exceptions import UnexpectedAlertPresentException
import time,os
import requests
fp = webdriver.FirefoxProfile('C:\\Users\\mo\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\b0wnbtro.dev-edition-default')
interest = input("Enter the interests seperate by a comma ")
msg1 = "1"
msg2 ="2"
msg3 = "3"
msg4 = "4"
driver = webdriver.Firefox(fp)
#2CAPTCHA API CODE INSERTED HERE FOR A TEST RUN BEFORE BEING INCORPORATED IN A LOOP …Run Code Online (Sandbox Code Playgroud)