Use headless Chrome only for pages whose content or links require JavaScript or browser interaction. For a small JavaScript crawler, Puppeteer can open pages, wait for the target content, extract the rendered DOM, and feed discovered links into a controlled URL queue. Fetch static pages with an ordinary HTTP client instead; a browser for every URL adds unnecessary work.
When a crawler needs a browser
Headless Chrome runs without a visible user interface. Chrome’s current Headless mode shares the Chrome implementation with headful mode. The older Headless implementation has been available as a separate chrome-headless-shell binary since Chrome 132.0.6793.0. See Chrome’s Headless documentation.
A browser is useful when the response HTML does not contain the material you need because JavaScript renders it, or when reaching that material requires an interaction. If the content and links are already present in the HTTP response, use a regular HTTP client. If the site’s framework offers prerendering and that meets your needs, consider it before operating a browser crawler. Chrome discusses these approaches in its guidance on rendering.
Choose an automation approach
| Option | What it offers | When to consider it |
|---|---|---|
| Puppeteer | JavaScript library for controlling Chrome or Firefox through DevTools Protocol or WebDriver BiDi; its guide documents installation and a basic browser/page lifecycle. | A natural fit for a Node.js project centered on Chrome. Pin versions and make browser installation explicit in development and CI. Puppeteer getting started. |
| Playwright | Supports browser automation and documents regular Chromium, a separate headless-shell download, newer Chromium Headless, and branded Chrome or Edge channels. | Consider it when its browser tooling or cross-browser support fits the target sites. Specify the browser mode and channel used in deployment; modes can behave differently. Playwright browser documentation. |
| Chrome command line | Chrome can be launched with --headless. |
Useful for one-off automation or learning the browser mode. A crawler with a queue, extraction logic, and recovery handling will generally benefit from an automation library. Chrome Headless documentation. |
There is no established performance winner here: the cited documentation does not provide a comparable crawler throughput or memory benchmark. Choose based on your runtime, browser-binary management, fidelity needs, deployment footprint, and interactions required by the target.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Plan the crawl before opening Chrome
- Set scope. Define allowed seed hosts and the crawl’s purpose. Do not include authenticated or private content unless you are authorized to access it. Check site terms and applicable rules.
- Create a URL frontier. Put seed URLs in a queue. Normalize consistently, track visited URLs, and reject unsupported schemes and out-of-scope hosts before navigation. Keep URL policy separate from page automation.
- Apply crawl policy. Fetch each host’s top-level
/robots.txt, use a descriptive crawler user agent, and apply matching parseable directives. Robots rules are crawler guidance, not permission or access control. - Choose retrieval per page. Fetch pages with a regular HTTP client when its response contains the needed content. Send pages requiring JavaScript rendering or interaction to the browser worker.
- Set resource limits. Bound browser concurrency, pace requests per host, set navigation and operation timeouts, and use capped retries with backoff. No universal safe request rate is established; adjust to site policy and observed server behavior.
Interpret robots.txt responses correctly
RFC 9309 says crawlers are requested to honor parseable rules and that the Robots Exclusion Protocol is not authorization. On successful retrieval, follow the parseable rules; the RFC recommends following at least five consecutive redirects. An unavailable file, such as one returning a 4xx response, may permit access under the protocol. If the file is unreachable because of server or network errors, such as a 5xx response, the crawler must assume complete disallow. The RFC says robots.txt generally should not be cached for more than 24 hours unless it is unreachable.
These protocol rules do not replace site terms or legal obligations. Google also explains that disallowed URLs may still be indexed when linked elsewhere, potentially without a snippet; robots.txt is not a way to secure information. Use controls such as authentication for private material, or an appropriate search-indexing control such as noindex where applicable. See Google’s robots.txt introduction.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Install Puppeteer and its browser
The example below uses Node.js and Puppeteer. Install the package in your project:
npm install puppeteer
Puppeteer’s installation normally handles a compatible browser download. If a package manager or environment blocks install scripts, the library may be present while its browser binary is missing. Follow the official Puppeteer installation guide to make browser installation explicit for your environment. Pin compatible package versions and verify the browser is available in CI or the deployment image.
Recommended Free Tools
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Build a small, bounded crawler
This runnable example uses a FIFO frontier, limits URLs to one host, checks robots policy before navigation, reuses one browser process, and closes each page when its work finishes. It waits for a target-specific selector rather than assuming that network quiet means the page is ready. Replace the sample host and selector with a site you are permitted to crawl.
import puppeteer from 'puppeteer';
const startUrl = new URL('https://example.com/');
const allowedHost = startUrl.hostname;
const userAgent = 'ExampleResearchCrawler/1.0 (+https://example.com/crawler-info)';
const maxPages = 20;
const navigationTimeoutMs = 30_000;
const readinessSelector = 'main'; // Change to a meaningful selector for the site.
const queue = [startUrl.href];
const visited = new Set();
const results = [];
function normalize(raw, base) {
try {
const url = new URL(raw, base);
if (url.protocol !== 'http:' && url.protocol !== 'https:') return null;
url.hash = '';
if (url.hostname !== allowedHost) return null;
return url.href;
} catch {
return null;
}
}
async function getRobotsPolicy() {
const robotsUrl = new URL('/robots.txt', startUrl.origin);
const response = await fetch(robotsUrl, {
headers: { 'User-Agent': userAgent },
signal: AbortSignal.timeout(10_000),
redirect: 'follow'
});
// A production crawler should distinguish unavailable (4xx) from
// unreachable (5xx/network error), apply RFC 9309 semantics, parse
// matching user-agent groups, and cache the result for no more than
// 24 hours unless the file is unreachable. This minimal example stops
// on non-success rather than treating the file as permission.
if (!response.ok) {
throw new Error(`Could not establish robots policy: HTTP ${response.status}`);
}
return await response.text();
}
function isDisallowedBySimpleRules(robotsText, pathname) {
// Demonstration only: this handles simple Disallow lines, not the full
// robots.txt matching and user-agent-group rules in RFC 9309.
const lines = robotsText.split(/r?n/);
let applies = false;
const disallowed = [];
for (const line of lines) {
const clean = line.split('#', 1)[0].trim();
const match = clean.match(/^([^:]+):s*(.*)$/);
if (!match) continue;
const key = match[1].toLowerCase();
const value = match[2].trim();
if (key === 'user-agent') applies = value === '*' || userAgent.toLowerCase().includes(value.toLowerCase());
if (key === 'disallow' && applies && value) disallowed.push(value);
}
return disallowed.some(path => pathname.startsWith(path));
}
const robotsText = await getRobotsPolicy();
const browser = await puppeteer.launch({ headless: true });
try {
while (queue.length && visited.size < maxPages) {
const url = queue.shift();
if (!url || visited.has(url)) continue;
visited.add(url);
const parsed = new URL(url);
if (isDisallowedBySimpleRules(robotsText, parsed.pathname)) {
results.push({ url, outcome: 'skipped-by-robots' });
continue;
}
const page = await browser.newPage();
try {
await page.setUserAgent(userAgent);
const response = await page.goto(url, {
waitUntil: 'domcontentloaded',
timeout: navigationTimeoutMs
});
await page.waitForSelector(readinessSelector, {
timeout: 10_000
});
const data = await page.evaluate(() => ({
title: document.title,
text: document.body?.innerText ?? '',
links: Array.from(document.querySelectorAll('a[href]'), a => a.href)
}));
const finalUrl = page.url();
results.push({
originalUrl: url,
finalUrl,
fetchedAt: new Date().toISOString(),
status: response?.status() ?? null,
outcome: 'success',
title: data.title,
text: data.text,
linksFound: data.links.length
});
for (const link of data.links) {
const next = normalize(link, finalUrl);
if (next && !visited.has(next)) queue.push(next);
}
} catch (error) {
results.push({
originalUrl: url,
finalUrl: page.url(),
fetchedAt: new Date().toISOString(),
outcome: 'error',
error: String(error)
});
} finally {
await page.close();
}
}
} finally {
await browser.close();
}
console.log(JSON.stringify(results, null, 2));
The simplified robots parser is deliberately not a complete RFC 9309 implementation. For a production crawler, use a tested parser that handles user-agent groups and rule matching, and implement the RFC’s fetch, redirect, caching, and error behavior. The sample also uses a single browser and processes URLs serially; increase throughput only with bounded concurrency and suitable per-host pacing.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Wait for what the crawler needs
domcontentloaded means the initial document has been parsed, not that a single-page application has finished rendering the content you want. The example then waits for main; choose a selector, state, or bounded delay that reflects the actual data requirement. Some sites need a more specific selector or interaction. Avoid treating networkidle as a universal readiness signal: analytics, long polling, and other persistent requests can make network-idle waits unreliable. Chrome’s rendering example demonstrates navigation and reading serialized page content, but production readiness should be specific to the target. See Chrome’s Headless documentation.
Extract and store auditable results
The example records the requested URL, final URL, fetch time, status when available, and outcome. A fuller crawler should persist extracted data and crawl state outside the browser process. Track queue depth, successes, errors, render time, and duplicate rate so coverage and resource use are observable. Keep a record of redirect destinations and extraction failures when those affect your downstream decisions.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Control resource use without breaking rendering
Pages can load substantial resources, but blocking them blindly may remove styles, scripts, or API responses required for rendering. Puppeteer supports request interception; Chrome’s example shows allowing document, script, XHR, and fetch requests while aborting other resource types. Treat that as a starting experiment, not a safe default. Compare extracted output with and without filtering on representative pages before enabling it broadly. The relevant example is in Chrome’s Headless documentation.
- Keep browser-process count and active pages bounded.
- Apply a per-host pace consistent with the site’s policy and responses; stop or slow down when behavior indicates strain.
- Use timeouts for navigation and readiness waits, and cap retries with backoff. Do not retry persistent policy denials or identical failures indefinitely.
- Close pages in a
finallypath and close the browser when the job ends. - Persist queue state and results so a browser crash does not erase crawl progress.
- Do not present a single request rate as universally safe; none is established for all sites.
Troubleshooting common failures
| Symptom | Likely cause | What to check or change |
|---|---|---|
| Puppeteer installs, but launch reports a missing executable. | An install script was blocked or the compatible browser was not installed in the runtime image. | Check the official installation steps, allow the intended browser installation process, or configure the binary explicitly. Verify the executable exists in CI and production. Puppeteer installation guide. |
| Navigation succeeds but extracted text is empty or incomplete. | The app has not rendered the target content yet, or the extraction selector does not match. | Wait for a meaningful, page-specific selector or state; inspect the rendered DOM and test the selector on representative pages. Avoid relying on a fixed delay unless it is bounded and justified. |
| A readiness wait times out. | The selector is wrong, content is absent for this page, or rendering failed. | Record the URL and failure outcome, verify the selector, and distinguish an expected empty page from a failed render. Avoid retrying the same unchanged condition without a cap. |
| Some sites render differently in deployment. | Browser mode, channel, or binary differs; Playwright’s Chromium and headless-shell modes are not interchangeable in every case. | Make the browser and mode explicit, pin versions, and reproduce production settings locally. For Playwright, review its browser-channel choices. Playwright browser documentation. |
| Navigation or extraction fails after resource blocking. | A blocked script, stylesheet, or API request is required by the page. | Disable interception or allow the required resource type, then compare results before applying a narrower filter. |
| The crawler sees the same pages repeatedly or grows without bound. | URL variants, query parameters, fragments, or off-scope links are expanding the frontier. | Normalize URLs consistently, remove fragments, enforce host and scheme rules before enqueueing, and set a crawl limit appropriate to the job. |
| Robots policy cannot be retrieved. | The robots endpoint may return an error or be unreachable. | Do not conflate 4xx unavailability with 5xx/network unreachability. Apply RFC 9309’s distinct behavior, log the result, and avoid proceeding when the file is unreachable and the protocol requires assuming complete disallow. |
Or skip the browser setup
For a one-off screenshot rather than a link-following crawler, ScreenshotNeo provides a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF. It is not a crawler frontier or a substitute for crawl-policy decisions; it is an option when the task is capturing pages rather than discovering and traversing links.
For example, save a screenshot of a page with cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request parameters. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Does robots.txt give me permission to crawl a site?
No. It communicates crawler guidance; it is not authorization. Check the site’s terms and applicable rules, and access only material you are authorized to crawl.
Should I use Puppeteer or Playwright?
Choose by runtime fit, browser management, required browser modes, cross-browser needs, and site interactions. The cited documentation does not establish a general crawler performance winner.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

