当前位置: 首页 > news >正文

门户网站开发介绍桥西区网站建设

门户网站开发介绍,桥西区网站建设,网站注册了域名然后怎么做,网站建设执行风险配置好接码api即可实现自动化注册登录试用一体。 运行后会注册账号并绑定邮箱与手机号进行登录试用。 测试结果30秒一个号 import re import time import requests from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options imp…

配置好接码api即可实现自动化注册登录试用一体。

运行后会注册账号并绑定邮箱与手机号进行登录试用。

在这里插入图片描述

测试结果30秒一个号

在这里插入图片描述
在这里插入图片描述

import re
import time
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import logging# 配置日志记录
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)# 获取手机验证码
def get_phone_verification_code(url):while True:try:response = requests.get(url)html_content = response.text# 使用正则表达式匹配验证码match = re.search(r'Your Poe verification code is: (\d+)\.', html_content)if match:code = match.group(1)logging.info("提取到的手机验证码: %s", code)return code  # 找到验证码则退出循环并返回验证码logging.info("未找到手机验证码,继续请求...")time.sleep(1)  # 等待 1 秒后再次请求except Exception as e:logging.error("请求手机验证码出错: %s", e)time.sleep(1)  # 出错时等待一段时间后再次请求# 获取邮箱验证码
def get_email_verification_code(url):while True:response = requests.get(url)html_content = response.text# 使用正则表达式匹配 6 位数字match = re.search(r'\b\d{6}\b', html_content)if match:code = match.group()logging.info("提取到的邮箱验证码: %s", code)return code  # 找到验证码则退出循环并返回验证码# 如果页面中没有 6 位数字验证码,使用 BeautifulSoup 进行解析soup = BeautifulSoup(html_content, 'html.parser')pre_element = soup.find('pre')if pre_element:code = pre_element.text.strip()logging.info("提取到的邮箱验证码: %s", code)return code  # 找到验证码则退出循环并返回验证码logging.info("未找到邮箱验证码,继续请求...")time.sleep(1)  # 等待 1 秒后再次请求# 登录循环
def login_loop(driver, wait_time):try:driver.delete_all_cookies()driver.get("https://poe.com/login")# 使用显式等待来等待按钮可见并且可点击use_phone_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//button[contains(text(), '使用电话')]")))use_phone_button.click()logging.info("点击了 '使用电话' 按钮")# 获取电话号码with open("phone.txt", "r") as file:lines = file.readlines()first_line = lines[0].strip()phone, phone_url = first_line.split("----")logging.info("获取到的电话号码: %s", phone)with open("phone.txt", "w") as file:file.writelines(lines[1:])# 输入电话号码并点击下一步按钮phone_input = WebDriverWait(driver, wait_time).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input.PhoneNumberInput_phoneNumberInput__lTKZv")))phone_input.send_keys(phone)phone_input.send_keys(Keys.RETURN)logging.info("输入电话号码并点击下一步按钮")# 输入电话号码验证码code_input = WebDriverWait(driver, wait_time).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input.VerificationCodeInput_verificationCodeInput__RgX85")))time.sleep(5)verification_code = get_phone_verification_code(phone_url)code_input.send_keys(verification_code)code_input.send_keys(Keys.RETURN)logging.info("输入电话号码验证码")# 获取邮箱with open("emai.txt", "r") as file:lines = file.readlines()first_line = lines[0].strip()email, email_url = first_line.split("----")logging.info("获取到的邮箱: %s", email)with open("emai.txt", "w") as file:file.writelines(lines[1:])# 输入邮件email_input = WebDriverWait(driver, wait_time).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input.EmailInput_emailInput__OfOQ_")))email_input.send_keys(email)email_input.send_keys(Keys.RETURN)# 输入邮件验证码verification_code_input = WebDriverWait(driver, wait_time).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input.VerificationCodeInput_verificationCodeInput__RgX85")))time.sleep(5)logging.info("获取邮箱验证码")verification_code = get_email_verification_code(email_url)logging.info("提交邮箱验证码")verification_code_input.send_keys(verification_code)verification_code_input.send_keys(Keys.RETURN)finally:# 关闭浏览器driver.quit()def main():# 设置等待时间wait_time = 30  # 以秒为单位while True:try:# 创建一个Chrome浏览器实例,启动无痕模式chrome_options = Options()chrome_options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36')chrome_options.add_argument('--lang=zh-CN')chrome_options.add_argument("--disable-blink-features=AutomationControlled")chrome_options.add_argument('--incognito')  # 启动无痕模式driver = webdriver.Chrome(options=chrome_options)login_loop(driver, wait_time)finally:# 关闭浏览器driver.quit()if __name__ == '__main__':main()
http://www.yayakq.cn/news/124490/

相关文章:

  • 局域网多网站建设做运营的具体做什么
  • 郑州锐旗网站公司网站如何添加js代码
  • 浙江省网站集约化建设哪里有微信网站开发公司
  • 微网站开发协议ui培训完找工作没人要
  • 绍兴做网站鼎成珠宝网站模板
  • 收录网站查询网站更改备案
  • 那个网站的机票做便宜聊城网站建设lchckj
  • 扫描二维码进入公司网站怎样做实时网站推广的最终目的是
  • 诏安建设局网站贵安新区网站建设
  • 网站 收录 做301如何制作外贸网站
  • 近期国际军事形势云南网站建设快速优化
  • 国家住房和城乡建设部网站查询网络营销简介
  • 国际网站怎么做网站建设销售话术文本格式
  • 海洋cms做电影网站好做吗厚街找人做网站
  • 重庆网站建设mlfart个人工作室网页设计模板
  • 嘉定网站建设公司厚街外贸网站建设公司
  • 软件开发过程包括哪些阶段seo优化收费
  • 找人做一个小网站需要多少钱做网站栏目都包括什么
  • 官方网站下载微博卧龙区微网站开发
  • 无锡做网站小程序怎么上架商品
  • dw网站大学生代做百度seo课程
  • 深圳网页设计网站制作oa系统登录网址
  • 网站优化教程新手学做网站的书
  • 网站开发设计师的工作网站做优化一开始怎么做
  • vs做的网站如何使用淘宝客怎么做自己的网站
  • 跨境电商网站开发上海高端网站建设定制
  • 哪方面的网站成都园林设计公司推荐
  • 推广型网站建设公司刚刚突发1惊天大事
  • 南通网站制作设计wordpress 主题制作软件
  • 博罗营销网站制作上传 wordpress