Skip to main content
Version: 4.0

Crawl a single URL

This example uses the impit npm package, the HTTP client behind Crawlee's default ImpitHttpClient, to grab the HTML of a web page while impersonating a browser.

Run on
import { Impit } from 'impit';

// Get the HTML of a web page
const impit = new Impit({ browser: 'chrome' });
const response = await impit.fetch('https://www.example.com');
console.log(await response.text());

If you don't want to hard-code the URL into the script, read it from a command-line argument or an environment variable, or, on the Apify platform, from the Actor input with Actor.getInput().