Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →To collect links from a JavaScript-driven page, use Chrome Headless to inspect its rendered DOM or use Puppeteer to return anchor data directly. For a quick inspection, run Chrome with --headless --dump-dom. For structured results in an application, use Puppeteer’s page.$$eval('a', ...) after the page has reached the state you need. The important choice is not just how to select links, but how to tell when the page has finished adding the links you want.
Choose between a DOM dump and structured extraction
| Approach | Best for | Output | Trade-off |
|---|---|---|---|
Chrome CLI with --dump-dom |
Quick checks, debugging, and shell workflows | Serialized page DOM | You must parse the output yourself and choose suitable capture timing. |
Puppeteer with page.$$eval('a', ...) |
Application code that needs link data | A serializable array, such as text-and-URL objects | You must manage navigation and readiness for the specific page. |
Puppeteer using chrome-headless-shell |
Automation where performance matters and regular Chrome compatibility is not required | Link data extracted through Puppeteer | Its behavior does not fully match regular Chrome; check compatibility. |
Chrome’s Headless command-line reference explains that --dump-dom prints a DOM Chrome has parsed and modified through script execution, then serialized back to HTML. It is not simply the original response body that a tool such as curl would retrieve. If your goal is to process links rather than inspect the whole page, Puppeteer avoids transferring and parsing more markup than you need.
Extract links with Puppeteer
Install and run a minimal script
Install Puppeteer in a Node.js project with npm install puppeteer. The following script opens a URL, waits for navigation to reach network idle, and returns each anchor’s trimmed text and resolved destination. Replace the example URL with the page you are permitted to access.
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com/', {
waitUntil: 'networkidle0',
});
const links = await page.$$eval('a', anchors =>
anchors.map(anchor => ({
text: anchor.textContent.trim(),
href: anchor.href,
}))
);
console.log(JSON.stringify(links, null, 2));
} finally {
await browser.close();
}
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});
page.$$eval finds all elements matching a selector, passes them to a function in the page context, and returns that function’s result. The CSS selector a selects anchor elements. Returning ordinary objects containing strings produces structured data your Node.js code can log, filter, or save. Puppeteer’s Page.$$eval() API reference documents this method, and its page interactions guide covers selector-based page work.
#1 Best Overall
- KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
- EASY SETUP: Experience simple installation with the USB wired connection
- VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
- SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
- FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
Choose what counts as a link
In this example, “links” means anchor elements in the document’s DOM. The returned anchor.href is the browser-resolved URL, which is usually useful when you need a destination to navigate to. If you instead need the literal value written in the markup—including a relative path—read anchor.getAttribute('href'). An anchor may have no href at all, so decide whether to keep entries with an empty or absent destination.
The example preserves duplicate anchors and does not test whether a link is visible, clickable, or reachable. Those are different questions from whether an anchor exists in the DOM. It also does not traverse iframe documents or shadow roots. If your definition of “all links” includes those areas, treat them as additional extraction scopes rather than assuming one document-wide querySelectorAll covers them.
Inspect a rendered page from the command line
For a quick rendered-DOM capture, run:
chrome --headless --dump-dom 'https://example.com/'
The command writes serialized DOM text to standard output. It is useful for verifying whether a page inserted anchors after its initial HTML arrived, but the output includes the rest of the DOM too. To turn it into a list of links, save the output and parse the HTML with a suitable parser, or use Puppeteer when you want a structured result directly.
Rank #2
- Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
- Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
- Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
- Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
- Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
Chrome’s command-line reference also documents --timeout and --virtual-time-budget controls for capture timing. The reference includes examples using a 5000 ms timeout and a 42000 ms virtual-time budget; these are flag examples, not promises that a particular page will finish loading in those intervals. After any timed capture, check that the expected anchors are present.
Recommended Free Tools
Wait for the page state that contains the links
Starting navigation is not the same as knowing that every link of interest has appeared. A page can add anchors after scripts run, after a request completes, or after a user action such as scrolling or opening a menu. Select a readiness condition based on what the target actually does.
Use network idle when it fits
The Puppeteer example uses waitUntil: 'networkidle0', a documented approach also shown in a historical Chrome-team example of navigating before reading page content: Headless Chrome: an answer to server-side rendering JavaScript sites. Treat it as one option, not a universal rule. A page with long polling or ongoing network traffic may not become idle, while a page can become idle before a later interaction reveals more links.
Rank #3
- All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
- Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
- Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
- Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
- Plastic parts in K120 include 51% certified post-consumer recycled plastic*
Wait for an observable page-specific condition
If the page exposes a stable element or state that indicates the relevant content is ready, wait for that condition instead of relying only on elapsed time. If you know a delay is necessary, use a bounded delay and verify the extracted result; a delay alone cannot establish that every asynchronous operation has completed. Likewise, the CLI timing flags control capture timing but do not know which links matter to your task.
Decide how broad the extraction should be
Before calling a result “all links,” settle the scope and output policy:
- Document anchors: The sample captures anchors in the current document’s DOM, including anchors that may not be visible.
- Frames and shadow roots: They are not traversed by the sample. Add separate handling if the target puts relevant content there.
- Duplicates: The sample returns one record per anchor. If you want unique destinations, deduplicate deliberately and decide whether differences in visible text matter.
- URL schemes: The sample does not filter destinations. Keep, reject, or classify non-HTTP links according to your use case.
- Visibility and usability: Finding a DOM anchor does not prove a person can see or activate it, nor that its destination is available.
Browser extraction describes what the page exposed to your browser session; it does not establish permission to crawl every destination. Follow the site’s access rules and avoid treating automation as a way to bypass access controls.
Rank #4
- 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
- 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
- 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
- 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
- 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
Headless mode and compatibility
Puppeteer’s current headless modes guide says that the old headless mode is now known as chrome-headless-shell and ships as a separate binary. The guide notes that this shell can be faster for some automation work, but does not fully match regular Chrome’s behavior. Choose it only when that trade-off suits your target; if extracted links differ or a page behaves unexpectedly, check the behavior in regular Chrome before treating the result as representative.
Troubleshoot missing or unexpected links
| Symptom | Likely cause | What to do |
|---|---|---|
| Some links are missing | Extraction ran before the scripts or requests that insert them completed. | Wait for a target-specific readiness signal, or adjust capture timing and confirm the expected anchors appear. |
| Navigation never reaches network idle | The page may keep network activity open, for example through ongoing requests. | Use a readiness condition tied to the content you need rather than treating network idle as mandatory. |
| The result contains relative-looking markup but the script returns full URLs | anchor.href resolves the destination in the page context. |
Use anchor.getAttribute('href') when the literal attribute value is what you need. |
| The output includes duplicate or hidden anchors | The selector returns matching DOM anchors, not unique or visibly usable destinations. | Apply an explicit deduplication or visibility policy after extraction. |
| The CLI output is difficult to process | --dump-dom returns serialized DOM text, not a link array. |
Parse the HTML output or switch to Puppeteer’s page.$$eval to return just the fields you need. |
| Regular Chrome and the headless shell behave differently | The shell does not fully match regular Chrome. | Check the same workflow with regular Chrome when compatibility is important. |
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server, not a link-extraction API. Use it when a clean visual capture is useful; it does not return anchor text or URLs. One GET request returns an image or PDF. For example, this cURL request saves a WebP screenshot:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/ -o shot.webp
See the ScreenshotNeo documentation for request options. Cookie banners are accepted before capture and more than 60 known consent platforms, newsletter popups, and chat widgets are removed; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsSign up for 1,000 free screenshots a month with no card.
Best Value
- All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
- Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
- Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
- Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
- Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
Frequently Asked Questions
Does Chrome Headless execute JavaScript before printing the DOM?
Yes. The Chrome Headless command-line reference says Chrome parses the HTML into a DOM, executes scripts that may alter it, and serializes the resulting DOM for --dump-dom.
Can this method extract links inside an iframe?
Not with the sample as written; it selects anchors in the current document. Frame contents need separate handling.
Is Puppeteer’s chrome-headless-shell identical to regular Chrome?
No. Puppeteer describes it as a separate binary that does not fully match regular Chrome.
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.

