python - 需要帮助使用 selenium python 和 2captcha 创建 Outlook 帐户 - Funcaptcha
问题描述
卡在验证码上 解决正在尝试使用一个名为 unicode 的项目,如果有人可以在这部分帮助我,将不胜感激使用 2Captcha
除了其他一切都在为我创建帐户之外,这只是一个我根本无法弄清楚的小问题
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from selenium.webdriver.support.select import Select
from twocaptcha import TwoCaptcha
from unicaps import CaptchaSolver,CaptchaSolvingService
#import email list
email_list = []
emails = open('email-creation-list.txt', 'r')
endOfFile = False
while endOfFile == False:
temp = emails.readline().strip()
if not temp:
endOfFile = True
else:
email_list.append(temp)
print((email_list))
cycle = 0
x = 1
while x == 1:
#main
GChrome = webdriver.Chrome()
GChrome.get('https://signup.live.com/signup')
time.sleep(4)
GChrome.find_element_by_link_text("Get a new email address").click()
time.sleep(3)
box_login = GChrome.find_element_by_xpath('//*[@id="MemberName"]')
box_login.click()
box_login.send_keys(email_list[cycle])
time.sleep(3)
box_login = GChrome.find_element_by_xpath('//*[@id="MemberName"]').send_keys(Keys.ENTER)
time.sleep(3)
box_password = GChrome.find_element_by_xpath('//*[@id="PasswordInput"]')
box_password.click()
box_password.send_keys('kPb8nzbckquxSa')
box_password = GChrome.find_element_by_xpath('//*[@id="PasswordInput"]').send_keys(Keys.ENTER)
time.sleep(2)
firstname = GChrome.find_element_by_xpath('//*[@id="FirstName"]')
firstname.click()
firstname.send_keys('John')
lastname = GChrome.find_element_by_xpath('//*[@id="LastName"]')
lastname.click()
lastname.send_keys('Doe')
lastname = GChrome.find_element_by_xpath('//*[@id="LastName"]').send_keys(Keys.ENTER)
time.sleep(2)
s = Select(GChrome.find_element_by_xpath('//*[@id="BirthDay"]'))
# select by option index
s.select_by_index(4)
time.sleep(2)
s2 = Select(GChrome.find_element_by_xpath('//*[@id="BirthMonth"]'))
s2.select_by_index(4)
month = GChrome.find_element_by_xpath('//*[@id="BirthYear"]')
month.click()
month.send_keys('1997')
month = GChrome.find_element_by_xpath('//*[@id="BirthYear"]').send_keys(Keys.ENTER)
time.sleep(2)
#unicaps
solver = CaptchaSolver(CaptchaSolvingService.TWOCAPTCHA, api_key='')
solver.get_balance()
solver = solver.solve_funcaptcha('B7D8911C-5CC8-A9A3-35B0-554ACEE604DA','https://signup.live.com/signup')
# solved = solver.solve_funcaptcha(
# public_key='B7D8911C-5CC8-A9A3-35B0-554ACEE604DA',
#page_url='https://signup.live.com/signup'
#)
time.sleep(10)
其他信息
- 二手 - Time,Selenium,2Capctha,Unicaps(如果你知道如何使用这个或替代方法,请告诉我)
- 2Captcha Python API - https://pypi.org/project/2captcha-python/ - 对python有点新,所以它对我没有任何用处
解决方案
推荐阅读
- jmeter - 如何让 JMeter 报告每个 http/jdbc 请求/样本所花费的时间
- kubectl - 无法通过 kubectl 公开特定的 Nodeport
- r - 如何提取两个字符串之间的数字?
- apache-spark - 如何使用 PySpark 1.6 读取镶木地板文件?
- jsf-2 - 如何在 JSF 应用程序中不再需要检测当前的 Backing Bean
- ios - 如何确保只有一个线程正在执行后台上下文块
- python - 我可以使用 child_process 在服务器上生成多个 python 输出吗?
- javascript - 如何在javascript中将formData对象转换为二进制?
- anypoint-studio - Cloudhub 连接器的凭据无效错误
- javascript - 组件无法监听 react-router