Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Download a website with JavaScript” can mean three different things: save a link-connected site for offline browsing, save a file that a webpage starts downloading after an interaction, or capture a JavaScript-rendered page as an image or PDF. Use HTTrack for the first, Playwright for the second, and a screenshot tool for the third. A crawler that reads a page’s HTML does not automatically run its JavaScript, and none of these methods recreates a site’s server-side application or database.

Choose the right kind of download

Decide what you need to have at the end. A local site mirror is a collection of fetched pages and resources with links adjusted for local browsing. A browser-triggered download is a file—such as a PDF or spreadsheet—that the page sends after JavaScript runs or someone clicks a control. A screenshot or PDF capture records a page’s appearance; it is not a navigable copy of the site.

Your goal Starting point What you get Important limit
Browse discoverable pages offline HTTrack A local mirror of fetched pages and resources, with links rewritten for browsing. It does not execute page JavaScript, so runtime-only URLs may be missed.
Save a file triggered by an interactive page Playwright The file produced by a browser download event. It does not automatically mirror the site or every application state.
Keep a visual record of a rendered page A screenshot or PDF capture tool An image or PDF of the page, rather than an offline website. A capture does not preserve working links, application behavior, or server data.

For an authenticated, highly interactive, or client-rendered application, there is no universal procedure that guarantees a complete offline version. A site can depend on server requests, login state, APIs, or interactions that a static mirror cannot reproduce.

Mirror a link-connected website with HTTrack

HTTrack recursively fetches pages and resources it can discover, stores them locally, and rewrites retained links for offline browsing. Its official command-line quick start is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.
httrack https://example.com/ --path mydir

Replace the example address with the site you are authorized to copy. The command creates the mirror in the selected output directory. HTTrack’s official documentation describes the default crawl as staying on the same host and following links. It also says the tool identifies itself as HTTrack and obeys robots.txt by default.

Start with the final address and a narrow scope

Open the site in a browser first and note its final address after redirects. For example, a starting URL on an apex domain may redirect to a www host, or an HTTP address may redirect to HTTPS. Since those destinations can change the host, a crawl started at the pre-redirect address may stop short under the default same-host scope. Begin at the canonical destination, then adjust scope only if you have a clear reason to include another host.

Keep the initial crawl focused. Expanding to external hosts can pull in unrelated material or much more data than intended. HTTrack documents a --near option for fetching off-host page requisites, but that broader reach can collect too much from an external host; a narrower host filter may be more appropriate. The tool also documents a --sitemap option: it checks sitemap declarations in robots.txt and falls back to /sitemap.xml. A sitemap can help reveal URLs, but it does not make JavaScript-rendered content available to the crawler.

Rank #2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Check the result instead of trusting the file count

  1. Run the mirror command from a directory where you can locate the output folder.
  2. When it finishes, inspect hts-log.txt and hts-err.txt in the output area for refused, redirected, or filtered URLs.
  3. Open the local index page in a browser and follow several links, including links into deeper sections.
  4. Check representative images, stylesheets, and other important resources. A mirror can appear complete while some assets or pages are absent.
  5. If something is missing, check the redirect destination, host scope, and filters before widening the crawl.

HTTrack’s command-line guide says its parser reads HTML and CSS links but does not run JavaScript. A page that constructs a URL at runtime, loads images only when they come into view, or reveals links only after an interaction can therefore point to material HTTrack never discovers. Logs and a manual review of the local pages help identify the gap; they do not turn a static crawl into a running copy of the web application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Save a file started by JavaScript with Playwright

Use a real browser when the task is to save an attachment that appears only after a page runs or after a click. Playwright’s documented pattern is to register for the browser’s download event before clicking, wait for the event, and then call saveAs. The event must be armed first so a quick download is not missed.

Install Playwright in a Node.js project and install the browser you intend to run. Replace the example URL, button name, and destination with values for the page you are permitted to access. The button name below is an example: use the accessible name actually exposed by the page.

Rank #3
Sale
WD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN
  • High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
  • Plug-and-play expandability
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • SuperSpeed USB 3.2 Gen 1 (5Gbps)
const { chromium } = require('playwright');
const fs = require('node:fs/promises');
const path = require('node:path');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext({ acceptDownloads: true });
  const page = await context.newPage();

  try {
    await page.goto('https://example.com/report', {
      waitUntil: 'domcontentloaded'
    });

    const downloadPromise = page.waitForEvent('download');
    await page.getByRole('button', { name: 'Download file' }).click();
    const download = await downloadPromise;

    const destination = '/path/to/save';
    await fs.mkdir(destination, { recursive: true });
    await download.saveAs(
      path.join(destination, download.suggestedFilename())
    );
  } finally {
    await context.close();
    await browser.close();
  }
})();

Save to a directory your process can write to. suggestedFilename() uses the name supplied for the download; if your workflow needs a fixed name, replace that part with a filename you choose. The code saves the file generated by this one interaction. If a site requires login, a prior selection, or another step before the download button works, automate those authorized steps before waiting for the download and clicking.

Why save before closing the browser context

Playwright documents browser downloads as temporary: the downloaded file is deleted when the browser context that produced it closes unless you persist it. Awaiting download.saveAs(...) before the context closes copies it to the destination. A download event also confirms that the browser began a download; it does not guarantee that the content is the report or data you intended, so check the saved file when correctness matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This browser workflow is not a site mirror. To reproduce more than one file, you need to identify and automate the relevant pages and interactions, and decide separately what content is actually available to save. It still cannot reconstruct server-side behavior simply by saving a browser download.

Or skip the browser setup

If what you need is a rendered screenshot rather than an offline site or an attachment, ScreenshotNeo returns a screenshot or PDF from one GET request. For example, this cURL request saves a WebP screenshot of the target page; see the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo can remove cookie or consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

This captures a page; it does not create an HTTrack-style offline site mirror or save a file triggered by a page button. To try ScreenshotNeo, sign up for the free plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common failures

  • The mirror contains only part of the site. Check whether the start address redirects to another host, then review the HTTrack logs for refused, redirected, or filtered URLs. Inspect the host scope and filters before allowing a wider crawl.
  • An image or page that appears in the live site is missing locally. It may be loaded or assembled by JavaScript, or exposed only after interaction. HTTrack does not run JavaScript; use an authorized browser workflow for a specific resource that requires interaction, and do not assume that a site-wide mirror can capture every rendered state.
  • A mirrored page opens but looks broken. Inspect local stylesheets, scripts, fonts, and images as well as the page HTML. HTTrack’s guide cautions that an apparently complete mirror may still lack resources; use the logs and test multiple pages rather than relying on the index alone.
  • Playwright times out waiting for a download. Confirm that the page reached the right state, the selector matches the actual control, and clicking it really initiates a browser download. If the page needs a selection or consent action first, perform that authorized interaction before registering and waiting for the event.
  • The Playwright file disappears after the script ends. Persist it with download.saveAs(...) before closing the browser context. Also confirm that the destination directory is writable.
  • The saved file is unexpected or empty. A download event indicates that a download began, not that it was the intended content. Check the filename and open or validate the saved file; if the page serves an error or login response as a file, fix the page state or access flow before saving again.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and responsible use

A crawler and an automated browser do different work. A crawler is suited to following discoverable links and fetching files without rendering each page as a user would. Playwright starts a browser and performs specific interactions, which is a better fit for a file behind a click but does not scale into a complete mirror automatically. The reviewed official documentation does not establish a universal runtime, completeness rate, or speed advantage for either approach; the result depends on the site, its access rules, and the material being requested.

Best Value
UnionSine 1TB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • 【Upgraded version】 - The mirror logo strip is combined with the striped non-slip design. The rounded corners of the shell are more suitable for holding. The strips play a heat dissipation function to ensure a stable and fast transmission process.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.

For reliability, retain the mirror logs, verify a sample of local pages and assets, and save browser downloads before their context closes. Avoid excessive or unnecessarily broad crawling. Copy only material you are entitled to access and retain, respect site terms and access controls, and consider the load that repeated requests place on the site. HTTrack’s documentation places responsibility for copying on the user.

HTTrack’s official homepage reports version 3.50-4, dated 2026-09-25, and lists Windows, macOS/Linux/Unix/BSD, and command-line availability; its interface guide also documents an Android app. These are vendor statements, not independent compatibility tests. The Playwright download workflow described here comes from its official /docs/next/ documentation as accessed on 2026-09-29. Because that is a moving documentation channel rather than a version-pinned reference, verify the documentation for your installed version if exact behavior is important.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
Bestseller No. 2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
SaleBestseller No. 3

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.