Originally published on eve.gd on 9 November 2023, last updated 6 September 2026.
Read this post on the web (with images, PDF and citation details)
My day job involves quite a lot of crawling lists of websites to determine statistics about Crossref members and their behaviours. A good example is something I wanted to know recently: in the current sample, how many members display the title and doi (according to the latest display guidelines) on that page? In other words, how many members are doing good things on their landing pages? This is also important because, if a high number of these pages are behaving well, then we can use this as a marker of semantic shift/change. That is, we can use it to detect when a new domain owner comes along, for instance, and changes the content so that it no longer reflects the original.
The problem is, loads of scholarly publishers use DRM techniques on their sites that block my crawls. We use systems like Playwright to remote control browsers to do the crawling, so that the request looks as * much like a genuine user as possible. However, lots of these sites detect headless browsers and block them with a 403 Permission Denied error.
There’s a great Github javascript suite that aims to help you evade headless detection. The tests it uses are:
a great Github javascript suite
Using the stealth plugin for Playwright allows me to evade most of these. I have also put in a pull request that patches the Connection Rtt value. This just leaves Mouse Move and Broken Image detection, which I thought would not outweigh all the other factors. I also jitter the connection with arbitrary delays so that it should appear to be coming at random intervals, rather than a robotic crawl.
the stealth plugin for Playwright
a pull request that patches the Connection Rtt value
Yet the basic fact is that I am still getting blocked. This does not happen when I put the browser into headful mode, so current detection techniques have clearly evolved in the past half decade (since Detect Headless) was designed. If anyone has further ideas or resources on headless detection and evasion I would be very interested to hear them. In the meantime, publishers: please don’t block bots! Many of them are NOT evil and simply people trying to understand the scholarly landscape at scale.
This reference list has been generated, in many cases, through an automated process and may therefore contain errors or incomplete metadata. It is provided purely as assistance for finding the items mentioned within this post.
1. ‘GitHub - infosimples/detect-headless: Access https://infosimples.github.io/detect-headless to run several headless detection tests against your browser.’, GitHub <https://github.com/infosimples/detect-headless>
2. ‘Headless browsers report navigator.connection.rtt to be zero’, GitHub <https://github.com/Granitosaurus/playwright-stealth/pull/7>
3. ‘playwright-stealth’, GitHub <https://github.com/Granitosaurus/playwright-stealth/tree/main>
https://github.com/infosimples/detect-headless
https://github.com/Granitosaurus/playwright-stealth/pull/7
https://github.com/Granitosaurus/playwright-stealth/tree/main