How to save HTML pages as one file?

后端 未结 4 654
谎友^
谎友^ 2021-02-12 12:21

I want to be able to save / archive HTML pages as one file (without those pesky external folders).

I want the resulting file to contain all styles, images, and links (vid

4条回答
  •  难免孤独
    2021-02-12 13:07

    Extending upon zTrix's answer, I would suggest avoiding the Chrome extension (which did not work for me at all) and instead going with one of these options:

    • Node.js: remy's inliner
      • Easy to install using npm
      • Many options, including flags for disabling minification/compression, maintaining external images, skipping videos, and more.
      • Caveat: (22 September 2017) fails to maintain styling and JavaScript functionality when compiling Slate builds. This won't affect most people directly, but it means that inliner will probably have issues with other pages. See this issue
      • Caveat: no options to "leave things alone": will either minify/uglify CSS/JS or beautify, but will not simply embed original source into HTML.
    • Python 2: zTrix's webpage2html
      • More conservative than inliner; works well for most cases.
      • zTrix fixed a bug (that inliner also seems to have) which ensures JavaScript/CSS functionality when compiling Slate builds. See this issue. (updated 29 September 2017)
      • Can be converted to Python 3 relatively painlessly
      • Caveat: cannot handle CSS @import

提交回复
热议问题