Jun 8, 2018

Dump HTML or PDF by Google Chrome from command line

Printing the DOM
The --dump-dom flag prints document.body.innerHTML to stdout:

chrome --headless  --dump-dom https://i88.ca/

Create a PDF
The --print-to-pdf flag creates a PDF of the page:

chrome --headless --print-to-pdf https://i88.ca/