monolith -- 命令行工具:保存网页到单个HTML页面

软件名称

monolith

应用平台

Windows / Linux

一句简介

保存网页到单个HTML页面

应用简介

一个数据囤积者的梦想成真。 将任何网页捆绑成一个单一的HTML文件。 你终于可以用存储在你宝贵的小驱动器某处的.html文件来取代那几十亿个打开的标签。

与传统的 "将页面另存为 "不同,monolith不仅可以保存目标文档,还可以一次性嵌入CSS、图像和JavaScript资产,产生一个单一的HTML5文档,这对存储和分享来说是件好事。

如果与用wget -mpk保存网站相比,这个工具将所有资产嵌入数据URL,因此可以让浏览器完全按照互联网上的方式渲染保存的页面,即使在没有网络连接的情况下。

官方网站

用法

monolith [网址] [参数] [输出的文件名]

monolith https://tuchong.com/1535376/t/15438303/ -o tuchong.html

参数

  • -a: Exclude audio sources
  • -b: Use custom base URL
  • -c: Exclude CSS
  • -C: Save document using custom charset
  • -e: Ignore network errors
  • -f: Omit frames
  • -F: Exclude web fonts
  • -i: Remove images
  • -I: Isolate the document
  • -j: Exclude JavaScript
  • -k: Accept invalid X.509 (TLS) certificates
  • -M: Don’t add timestamp and URL information
  • -n: Extract contents of NOSCRIPT elements
  • -o: Write output to file (use “-” for STDOUT)
  • -s: Be quiet
  • -t: Adjust network request timeout
  • -u: Provide custom User-Agent
  • -v: Exclude videos

我自己写了个批处理,还算方便:

@echo off 
title monolith download
@rem color f0
mode con cols=72 lines=22
:menu
echo                 monolith webpage save
echo =======================================================================
set /p a=请输入网址:
set /p b=请输入文件名 不要加空格:
@rem color f0
mode con cols=80 lines=25
monolith.exe -j -I -f %a% -o %b%.html
cls
title 完成
echo 保存完毕!请按回车退出
echo.                                  &pause >nul

下面不是有相关的项目吗?可以用chrome的插件。

为什么不用自带的保存为mhtml呢? 同样是单文件的

视频能保存下来么

平时 SingleFile 也基本够用了,也可以将网页另存为一个Html单文件

1 个赞

命令行我喜欢, 可是用其尝试下载本页(monolith -- 命令行工具:保存网页到单个HTML页面):

使用monolith: monolith https://meta.appinn.net/t/topic/28979 -o testing.html, 得到的是一个带loading转圈的空白页面.

再尝试 monolith -j -I -f https://meta.appinn.net/t/topic/28979 -o testing.html, 得到一个空白页.

以上查看testing的源码都是有内容的.

而使用浏览器(chrome类)的保存为单页mhtml, 却能完整显示. 可惜的是该文件的源码将中文全部编码, 所以无法内容索引.

也许还有待优化? 感谢.

小众的这个论算动态网页程序了,太多JS。
你可以用 monolith -n -I -f https://meta.appinn.net/t/topic/28979 -o testing.html

-n的作用是把js替换掉(得到静态页面)。-J是移除js(所以没效果)
你查看一下上方的参数,其实很容易理解。

非常感谢! 我研究研究.

你给的代码确实可以得到一个可用的html.