Skip to content

puppeteer-stealthvscurl-impersonate

MIT 301 30 94,086
3.6 million (month) May 29 2018 2.11.2(2023-04-11 04:13:00 ago)
5,944 1 79 MIT
Feb 23 2022 v0.6.1(2024-03-02 18:08:29 ago)

Puppeteer Stealth is puppeteer plugin that fortifies headles browser for web scraping. This makes detection of puppeteer scrapers more difficult allowing to scrape targets which use headless browser detection techniques.

Puppeteer-stealth does this by applying various javascript patches to cover up traces of headless browser presence in the web scraping browser's environment.

Curl-impersonate is a special build of libcurl and cURL HTTP client that impersonates the four major browsers: - Google Chrome - Microsoft Edge - Safari - Firefox Curl-impersonate achieves this by patching TLS and HTTP fingerprints to be identical to that of one of these real browsers.

Unlike other HTTP clients curl-impersonate can bypass TSL and HTTP fingerprinting and detection techniques though it does not implement anything for Javascript fingerprint or bypass.

Highlights


bypasshttp2tls-fingerprinthttp-fingerprintlow-level

Example Use


```javascript const puppeteer = require('puppeteer-extra') // add stealth plugin and use defaults (all evasion techniques) const StealthPlugin = require('puppeteer-extra-plugin-stealth') puppeteer.use(StealthPlugin()) // puppeteer usage as normal puppeteer.launch({ headless: true }).then(async browser => { console.log('Running tests..') const page = await browser.newPage() await page.goto('https://bot.sannysoft.com') await page.waitForTimeout(5000) await page.screenshot({ path: 'result.png', fullPage: true }) await browser.close() console.log("success - check the result.png screenshot") }) ```
curl-impersonate installs itself under `curl_` terminal commands like `curl_chrome116`: ```shell $ curl_chrome116 https://www.wikipedia.org ``` To use it in HTTP client libraries that use `libcurl` replace curl path with one of these. To use it in python directly see curl-cffi Python package

Alternatives / Similar


Was this page helpful?