項目場景:
需要控制滑塊,完成訪問驗證
?
問題描述
使用selenium進行滑塊識別,總是失敗。
原因分析:
網(wǎng)站識別出是機器在進行爬取。
解決方案:
1、設(shè)置ChromeOptions
實現(xiàn)規(guī)避檢測,讓網(wǎng)站檢測不到。
# 實現(xiàn)規(guī)避檢測
option = ChromeOptions()
option.add_argument("--disable-blink-features=AutomationControlled")
2、調(diào)整Chorme特征值
讓系統(tǒng)不認(rèn)為chorme是機器在操作文章來源:http://www.zghlxwxcb.cn/news/detail-545634.html
用16進制編輯器打開Chormedriver.exe,查找并替換
$cdc_lasutopfhvcZLmcfl
為等量字符的內(nèi)容。完成以上兩步即可,親測有效文章來源地址http://www.zghlxwxcb.cn/news/detail-545634.html
到了這里,關(guān)于selenium解決巨難的js逆向滑塊驗證問題?。?!的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!