真的滿厲害的,可以檢查的出來用戶端使用了 chromedriver。
測試用網址:
https://recaptcha-demo.appspot.com/
有沒有使用(success) chromedriver 還有得分(score) 都可以在上面的網址看到結果。
相關討論:
- How does recaptcha 3 know I’m using selenium/chromedriver?
https://stackoverflow.com/questions/55501524/how-does-recaptcha-3-know-im-using-selenium-chromedriver - Selenium webdriver: Modifying navigator.webdriver flag to prevent selenium detection
https://stackoverflow.com/questions/53039551/selenium-webdriver-modifying-navigator-webdriver-flag-to-prevent-selenium-detec/
解法:
Before (in browser console window):
> navigator.webdriver
true
Change (in selenium):
// C#
var options = new ChromeOptions();
options.AddExcludedArguments(new List<string>() { "enable-automation" });
// Python
options.add_experimental_option("excludeSwitches", ['enable-automation'])
After (in browser console window):
> navigator.webdriver
undefined