本文只针对横向由左向右滑动的验证码
目标网站为https://login.aliexpress.com/seller.htm(速卖通-阿里巴巴国际站)
def sliding_verification(chrome):
# 获取拖拽的滑动验证码块
# 按钮xpath
time.sleep(2)
slideblock = chrome.find_element_by_xpath('//*[@id="nc_1_n1z"]')
# 鼠标点击滑动块不松开
time.sleep(1)
ActionChains(chrome).click_and_hold(slideblock).perform()
# 将圆球滑至相对起点位置的 右边xx
for i in range(4):
ActionChains(chrome).move_by_offset(xoffset=70, yoffset=0).perform()
time.sleep(1)
time.sleep(1)
# 放开滑动块
ActionChains(chrome).release(slideblock).perform()
time.sleep(3)
本文详细探讨了如何应对横向滑动验证码的挑战,特别是针对速卖通-阿里巴巴国际站的登录验证。建议的策略是每秒滑动一次,每次滑动1/4的验证码区域。随着网站界面的更新,此方法可能需要适时调整。
订阅专栏 解锁全文
5065





