Save HTML As Standalone Page: Exporting Tool?
Asked Answered
G

2

7

I need to regularly send html pages to a client as standalone .html files with no external dependencies. The original pages are done with node.js and express and they contains several librairies such as High Charts. I have done the preparation manually until now, this includes:

  • Transform all images into blobs
  • Copy all external .js and .cs inside the page
  • Minimize where possible (standards librairies such as jQuery or Bootstrap...)

The result is a single .html file that can be opened without an internet connection and looks just like the original.

Is there any tool to do this automatically? If not, maybe I'll code it myself in Python. Do you have any recommendation around that?

Thanks

Gantry answered 4/7, 2014 at 6:50 Comment(2)
Do u really embed something like this into your page? And u dont have to be offensive. I am just looking for YOUR PROBLEM's solution! If u already know the answers why did u asked them in here. And try to embed bigger images in to your html like this and see the result ;)Googly
You are right. Look I need to send a single text file that has all functionalities. I know how to do it manually, I'm just looking for an automatic tool before I code one myself. CheersGantry
O
2

Monolith is a CLI tool for saving complete web pages as a single HTML file

See https://github.com/Y2Z/monolith

Olin answered 16/10, 2020 at 3:59 Comment(0)
T
0

With apologies to OP, as this answer is probably far too late for him, but I'm posting it to help anyone with a similar problem:

HTTrack is an open-source project that does almost exactly what you described, though it doesn't work perfectly on some of the more peculiar JS.

It saves the page with most of the JS, the major images, and everything that the page needs to appear complete. It can be configured to include or exclude the entire or partial JS, images, and CSS.

enter image description here

This does not import all of the JS and other content into the HTML file, but neatly organizes all of the content into one folder and corrects all of the paths to make the folder portable.

It also seems to have trouble grabbing some external sources that are protected, but if it is your local site and simply uses common scripts like JQuery, you should be fine. When I tested it, it correctly downloaded all of my local CSS and any valid external CSS library that I incorporated, the JQuery and derivative scripts that I was using, and the embedded images.

Just to save everyone a question, the program by default saves the downloaded websites to C:\My Web Sites.

Telephoto answered 30/5, 2016 at 12:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.