微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

验证码破解全家桶滑动验证码、数字验证码、极验验证码

一、滑动验证码:(以企查查为例)

from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver import ActionChains
from selenium.webdriver.support.ui import webdriverwait
#滑块验证
def validation():
    button_status = is_element_exist('nc_1_n1z')  # 按钮状态
    if button_status:
        button = webdriverwait(driver, timeout=10, poll_frequency=0.5).until(
            lambda x: x.find_element_by_id('nc_1_n1z'),
            message='按钮定位超时')
    else:  # 滑动失效
        button = webdriverwait(driver, timeout=10, poll_frequency=0.5).until(
            lambda x: x.find_element_by_id('nc_2_n1z'),
            message='按钮定位超时')
    # 滑动滑块
    ActionChains(driver).click_and_hold(button).perform()
    ActionChains(driver).move_by_offset(xoffset=263, yoffset=0).perform()  #263是滑动距离坐标,可从源码算出
    ActionChains(driver).release().perform()
    time.sleep(1)

二、数字字母验证码(以知乎为例)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐