Scrape
Scrape any site and get it's data.
2
Setup your Environment
To use Hyperbrowser with your code, you will need an API Key. You can get one easily from the dashboard. Once you have your API Key, add it to your .env
file as HYPERBROWSER_API_KEY
.
3
Scrape a Site
Next, you can scrape any site by simply setting up the Hyperbrowser client and providing the site's url.
import { Hyperbrowser } from "@hyperbrowser/sdk";
import { config } from "dotenv";
config();
const client = new Hyperbrowser({
apiKey: process.env.HYPERBROWSER_API_KEY,
});
const main = async () => {
const scrapeResult = await client.scrape.startAndWait({
url: "https://example.com",
});
console.log("Scrape result:", scrapeResult);
};
main();
4
View Scrape in Dashboard
You can view all your scrapes in the dashboard and see all their related information.
More information about sessions, including user profiles, web recordings, live view, and more can be found in the Sessions Overview
To view more details check out the Scrape page.
Last updated