Selenium webdriver: Modifying navigator.webdriver flag to prevent selenium detection

前端 未结 10 831
既然无缘
既然无缘 2020-11-22 00:57

I\'m trying to automate a very basic task in a website using selenium and chrome but somehow the website detects when chrome is driven by selenium and blocks every request.

10条回答
  •  甜味超标
    2020-11-22 01:24

    Do not use cdp command to change webdriver value as it will lead to inconsistency which later can be used to detect webdriver. Use the below code, this will remove any traces of webdriver.

    options.add_argument("--disable-blink-features")
    options.add_argument("--disable-blink-features=AutomationControlled")
    

提交回复
热议问题