|
|
|
|
|
by simonw
821 days ago
|
|
Well this is fun... from the README here I learned I can do this on macOS: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--headless --incognito --dump-dom https://github.com > /tmp/github.html
And get an HTML file for a page after the JavaScript has been executed.Wrote up a TIL about this with more details: https://til.simonwillison.net/chrome/headless My own https://shot-scraper.datasette.io/ tool (which uses headless Playwright Chromium under the hood) has a command for this too: shot-scraper html https://github.com/ > /tmp/github.html
But it's neat that you can do it with just Google Chrome installed and nothing else. |
|