3 ms·
PDFs are really not suitable for archiving websites since they're designed around pages and the web does not have pages. A better option is to render a page wi
by driverdan 10y ago
PDFs are really not suitable for archiving websites since they're designed around pages and the web does not have pages.
A better option is to render a page with JS turned on and save the resulting HTML.
- TazeTSchnitzel 10y agoPDFs have the advantage of being a fixed format that should display the same everywhere. It's probably less fragile than modern CSS or HTML. However, as you point out, PDFs are designed around the printed page, not the flowing arbitrary-page-size documents of the web.
- nikisweeting 10y agoI was doing this before with the chrome --dump-dom flag but the output I was getting was garbage, and no more useful than the simpler wget download. PDF turned out to produce really nice, readable archives about 75% of the time, so I kept it in. Text-based sites tend to do a good job of having PDF-friendly styling.
- ianbicking 10y agoI've been trying to do something like this in this project: https://github.com/ianb/pagearchive https://github.com/ianb/pagearchive It came out of a screenshot/archiver I've been working at at Mozilla, but I've split it up as the screenshotting is shipping and DOM archiving is still way outside Mozilla's comfort zone.
- zulln 10y agoI googled it, and --dump-dom simply dumps the output of document.body.innerHTML. I have not used headless chrome at all, but I imagine it would not be that hard to get it to dump document.documentElement.outerHTML instead. (execute JavaScript on the page is most likely possible?)