#!/usr/bin/env python
# encoding: utf-8
import numpy as np
import random
from selenium.webdriver import ActionChains
import time
from selenium.webdriver import Chrome
from selenium.webdriver import ChromeOptions
from PIL import Image
import os
from selenium.webdriver.support.ui import WebDriverWait
import cv2
class Login(object):
"""
腾讯防水墙滑动验证码破解
使用OpenCV库
成功率大概90%左右:在实际应用中,登录后可判断当前页面是否有登录成功才会出现的信息:比如用户名等。循环
https://open.captcha.qq.com/online.html
破解 腾讯滑动验证码
腾讯防水墙
python + seleniuum + cv2
"""
def __init__(self):
# 如果是实际应用中,可在此处账号和密码
self.url = "https://urlsec.qq.com/report.html"
self.option = ChromeOptions()
self.option.add_argument('--user-agent=Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30')
self.option.add_argument(r'--user-data-dir=C:\Users\admin\AppData\Local\Google\Chrome\User Data')
# self.option.add_argument('--disable-extensions')
# self.option.add_argument('--profile-directory=Default')
# self.option.add_argument("--incognito")
# self.option.add_argument("--disable-plugins-discovery")
# self.option.add_argument("--start-maximized")
# self.option.add_experimental_option('excludeSwitches', ['enable-automation'])
self.driver = Chrome(options=self.option)
@staticmethod
def show(name):
cv2.imshow('Show', name)
cv2.waitKey(0)
cv2.destroyAllWindows()
@staticmethod
def webdriverwait_send_key
使用OpenCV库破解腾讯防水墙滑动验证码
最新推荐文章于 2024-08-29 15:54:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)