如何将网站转换为“计算”形式?

发布于 2025-02-10 08:29:11 字数 242 浏览 1 评论 0原文

我想重写一个HTML文件,该文件将多个样式表引用到新的HTML文件中,其中标签仅包含最终计算的样式。这是为了进一步处理该站点,需要知道诸如颜色之类的样式,以避免在以后的处理中实现相当复杂的样式扣除逻辑(例如CSS选择器)。

是否有一些建议,简单的方法?我尝试将文件保存在Chrome和Firefox中,但它们主要重现原始内容,包括CSS文件。另一个选择是编写一个程序,其中包括一些HTML渲染器(例如Javafx)并手动浏览该文件,但也许有一种简单的方法。

I'd like to re-write a HTML file that references several stylesheets into a new HTML file, where the tags contain only the final, computed styles. This is for further processing of the site where styles such as color need to be known, to avoid having to implement the rather complex logic of style deduction (such as CSS selectors) in that later processing.

Is there some recommended, simple way to do this? I tried saving the file in Chrome and Firefox, but they mostly reproduce the original content, including the CSS file(s). Another option would be to write a program that includes some HTML renderer (such as JavaFX) and manually go through the file, but maybe there is a simpler way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文