ulixee / secret-agent

The web scraper that's nearly impossible to block - now called @ulixee/hero
https://secretagent.dev
MIT License
653 stars 43 forks source link
automated browser chromium devtools mitm mitmproxy playwright proxy puppeteer scraping secretagent stealth

SecretAgent 2.0 === Hero

:bell: SecretAgent 2.0 is named "Hero" and currently in alpha testing. We're ready for developers to begin to switch over - it's a pretty easy transition (migration guide). Follow along with development of Hero here or check out the latest npm packages @ulixee/hero-playground.


SecretAgent

SecretAgent is a web browser that's built for scraping.

Check out our website for more details.

Installation

npm i --save secret-agent

or

yarn add secret-agent

Usage

SecretAgent provides access to the W3C DOM specification without the need for Puppeteer's complicated evaluate callbacks and multi-context switching:

const agent = require('secret-agent');

(async () => {
  await agent.goto('https://example.org');
  const title = await agent.document.title;
  const intro = await agent.document.querySelector('p').textContent;
  await agent.close();
})();

Browse the full API docs.

Contributing

We'd love your help in making SecretAgent a better tool. Please don't hesitate to send a pull request.

License

MIT