Skip to content

Instantly share code, notes, and snippets.

@jdalley
Created March 15, 2025 19:49
Show Gist options
  • Save jdalley/7e540c9ee2cf39bc50c51e71a81bf9d6 to your computer and use it in GitHub Desktop.
Save jdalley/7e540c9ee2cf39bc50c51e71a81bf9d6 to your computer and use it in GitHub Desktop.
Downloading Dynamic Webpages With Chrome and Monolith

The following is a set of instructions for downloading a static or dynamic webpage into a single .html file.

Tools

  1. Download and install Monolith: https://github.com/Y2Z/monolith
    • If on Windows, I recommend using winget: winget install --id=Y2Z.Monolith -e
  2. Download and install Chrome if you don't currently use it.

With Monolith and Chrome installed, you should have access to their executables via command line (PowerShell recommended for Windows).

You can test both by trying them out in PowerShell:

  • monolith --version -> This will print the version of the Monolith CLI.
  • chrome -> This will open a chrome window if it's working.

Process

If you're downloading a static page that doesn't have any dynamically loading content (content that loads after the initial webpage loads), you can use Monolith by itself:

monolith http://eternal-city.wikidot.com/missile-weapons-bows -o missile-weapons-bows.html

If you're after a page that has dynamic content, you'll have to first open a headless Chrome window and pipe that content into Monolith:

chrome --headless --window-size=1920,1080 --run-all-compositor-stages-before-draw --virtual-time-budget=9000 --incognito --dump-dom http://eternal-city.wikidot.com/rank-bonus-calculator | monolith - -I -b http://eternal-city.wikidot.com/rank-bonus-calculator -o rank-bonus-calculator.html

PowerShell Script

Here is a set of PowerShell scripts to help automate this: https://github.com/jdalley/page-downloader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment