1

I just wanted to know is it detectable for webpages that we use a debugging mode browser like the below code:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

# already opened a browser in debugging mode at port 8989

opt = Options()
opt.add_experimental_option('debuggerAddress', 'localhost:8989')
driver=webdriver.Chrome(executable_path="my driver path", chrome_options=opt)
driver.get('http://google.com')
KianRST
  • 114
  • 14
  • It's not trivial but it is detectable. – Klaus D. Aug 01 '21 at 21:35
  • @KlausD. , I actually want to know if this method is better than using normal selenium, for opening webpages that are sensitive to automated software & have bot detection system, is it? – KianRST Aug 02 '21 at 07:50
  • 1
    Maybe this thread could help you https://stackoverflow.com/questions/66989755/getting-403-when-using-selenium-to-automate-checkout-process/67070031#67070031 – Mattia Galati Aug 04 '21 at 15:00

1 Answers1

4

Yes, Selenium is fairly easily detected, especially by all major anti-bot providers (Cloudflare, Akamai, etc).

Why?

  1. Selenium, and most other major webdrivers set a browser variable (that websites can access) called navigator.webdriver to true. You can check this yourself by heading to your Google Chrome console and running console.log(navigator.webdriver). If you're on a normal browser, it will be false.

  2. The User-Agent, typically all devices have what is called a "user agent", this refers to the device accessing the website. Selenium's User-Agent looks something like this: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/59.0.3071.115 Safari/537.36. Did you catch that? HeadlessChrome is included, this is another route of detection.

These are just two of the multiple ways a Selenium browser can be detected, I would highly recommend reading up on this and this as well.

And lastly, if you want an easy, drop-in solution to bypass detection that implements almost all of these concepts we've talked about, I'd suggest using undetected-chromedriver. This is an open source project that tries it's best to keep your Selenium chromedriver looking human.

dir
  • 661
  • 3
  • 13