Skip to content

puppeteer-stealthvscurl-impersonate

MIT 276 30 88,607
986.9 thousand (month) May 29 2018 2.11.2(1 year, 6 months ago)
3,751 1 65 MIT
Feb 23 2022 v0.6.1(7 months 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


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`:
$ 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?