提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
1.chrome的版本号小于88
from selenium.webdriver import Chrome
web = Chrome()
web.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument",{
"source": """
Object.defineProperty(navigator, 'webdriver', {
get: () => undefined
})
"""
})
2.chrome的版本号大于88
from selenium.webdriver.chrome.options import Options
option = Options()
option.add_experimental_option('excludeSwitches', ['enable-automation'])//可有可无
option.add_argument('--disable-blink-features=AutomationControlled')
web = Chrome(options=option)