使用selenium的无头浏览器时,由于selenium的特征很明确,很容易进行针对性的反爬。可以考虑在webdrive中增加以下代码:
cls.driver = webdriver.Chrome(options=cls.ch_options, service=cls.ch_service)
cls.driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
"source": """
Object.defineProperty(navigator, 'webdriver', {
get: () => undefined
})
"""
})
原创文章,作者:熊阿初,如若转载,请注明出处:https://www.guofc.com/1184.html
评论列表(8条)
antibiotics for sinus infection
antibiotics for sinus infection
lasix generic cost
lasix generic cost
doxycycline for dog side effects
doxycycline for dog side effects
can doxycycline hyclate cause headaches
can doxycycline hyclate cause headaches
flagyl uses tooth infection
flagyl uses tooth infection
sildenafil citrate 100 mg oral tablet
sildenafil citrate 100 mg oral tablet
ketoconazole for redness and scaling
ketoconazole for redness and scaling
ketorolac tromethamine safety
ketorolac tromethamine safety