解決采集時使用selenium被屏蔽的辦法
實用seleniumbase uc模式
from seleniumbase import Driver
driver = Driver(uc=True) # 使用UC模式
UC模式是基于undetected-chromedriver 但做了一些優(yōu)化更新,使用起來更方便
官方例子:文章來源:http://www.zghlxwxcb.cn/news/detail-835586.html
from seleniumbase import Driver
driver = Driver(uc=True)
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", 5)
driver.quit()
關(guān)于seleniumbase 更多,請參考官方文檔
https://seleniumbase.io/help_docs/uc_mode/文章來源地址http://www.zghlxwxcb.cn/news/detail-835586.html
到了這里,關(guān)于解決采集時使用selenium被屏蔽的辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!