Can You Hide Your Selenium or Puppeteer Bot? See Why Websites Detect Them
This article demonstrates how websites can detect browsers driven by Selenium or Puppeteer, walks through experiments using bot.sannysoft.com, shows screenshots of detected features in both headed and headless modes, and explains why such tools often fail to evade detection.
Many people think using Selenium or Puppeteer (Pyppeteer) to simulate a browser can avoid detection, but browsers launched by these tools expose dozens of detectable features via JavaScript.
To illustrate, open https://bot.sannysoft.com/ in a normal browser and observe the green page.
Then launch Chrome in headed mode with Selenium and open the same page. The WebDriver entry is highlighted in red, indicating detection, and many other features are also flagged.
In headless mode the same detection occurs. Example code:
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = Chrome('./chromedriver', options=chrome_options)
driver.get('https://bot.sannysoft.com/')
driver.save_screenshot('screenshot.png')The resulting screenshot shows the detection markers.
Using Pyppeteer yields similar results. The headless Pyppeteer screenshot looks like this:
Thus, relying on Selenium or Puppeteer for scraping sites with strong security teams is risky, as detection is straightforward.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
