当前位置:   article > 正文

Python Selenium 过 检_python selenium excludeswitches

python selenium excludeswitches
  1. from selenium import webdriver
  2. options = webdriver.ChromeOptions()
  3. options.add_experimental_option("excludeSwitches", ["enable-automation"])
  4. options.add_experimental_option('useAutomationExtension', False)
  5. driver = webdriver.Chrome(options=options, executable_path='./chromedriver')
  6. driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
  7. "source": """
  8. Object.defineProperty(navigator, 'webdriver', {
  9. get: () => undefined
  10. })
  11. """
  12. })
  13. driver.get('http://exercise.kingname.info')

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/89857
推荐阅读
相关标签
  

闽ICP备14008679号