"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Can the website detect that you use Selenium and Chromedriver

Can the website detect that you use Selenium and Chromedriver

Posted on 2025-04-20
Browse:748

Can Websites Detect Your Use of Selenium with Chromedriver?

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:

  • Checking window and document objects for specific detection keys (e.g., __webdriver_evaluate)
  • Identifying variables including $cdc_ that are associated with Selenium
  • Examining event listeners for patterns indicative of automated behavior

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.

Latest tutorial More>

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