简体   繁体   English

在没有 JavaScript 的情况下复制网站以供离线查看(html 和 .js 外部的脚本标签)

[英]Copy a website for offline view without JavaScript (script tags in html and .js externals)

I'm trying to copy a website for offline view without any dependencies.我正在尝试复制一个网站以供离线查看,没有任何依赖关系。

I want to copy the HTML without SCRIPT tags (javascript specifically) and without external scripts (.js).我想复制不带 SCRIPT 标签(特别是 javascript)且不带外部脚本 (.js) 的 HTML。

Been trying to do that with WGET --ignore-tags and HTTrack and it didn't work as expected.一直在尝试使用WGET --ignore-tags和 HTTrack 来做到这一点,但它没有按预期工作。 Scripts are copied as a whole.脚本作为一个整体被复制。

Calling Chrome in Headless mode eg chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/ will dump the HTML of a rendered DOM without any JavaScript.Headless 模式下调用 Chrome,例如chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/将在没有任何 JavaScript 的情况下转储呈现的 DOM 的 HTML。

This post describes how a crawler was built using Headless Chrome and Puppeteer.这篇文章描述了如何使用 Headless Chrome 和 Puppeteer 构建爬虫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM