Can Websites Detect Selenium with Chromedriver?
It may be surprising to discover that some websites can identify when you're using Selenium with Chromedriver, even if you're not actively automated. This is attributed to the fact that these websites employ bot detection scripts.
How do Websites Detect Selenium?
Bot detection scripts inspect predefined JavaScript variables that emerge when Selenium is employed. They search for declarations containing "selenium" or "webdriver" in window objects or document variables like $cdc_ and $wdc_.
Methods to Evade Detection
To avoid detection, you can remove these telltale variables. In the case of Chrome, removing $cdc_ is sufficient. This adjustment can be made to the chromedriver source code.
Bot Detection Pseudocode
Bot networks use a range of techniques to detect automation, such as:
Conclusion
While Chromedriver and Chrome might seem identical to web servers, sophisticated detection methods employed by websites can uncover the presence of Selenium. By removing telltale variables or employing advanced techniques, you can attempt to evade detection when using Selenium for testing or other purposes.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3