如何在Chrome中以当前状态转储整个Web DOM? [英] How can I dump the entire Web DOM in its current state in Chrome?
问题描述
我想将当前DOM转储到文件中并能够脱机查看。本质上,我有一个页面的过时版本,我想保留它进行比较。关闭浏览器后,我将立即丢失它,因此我想按原样保存DOM。
I want to dump the current DOM to a file and be able to view it offline. Essentially, I have an outdated version of a page that I would like to keep around for comparison. As soon as I close my browser, I'm going to lose it so I would like to save the DOM exactly as it is.
有已经在Firefox中执行此操作的答案,但是我如何在Chrome中执行此操作?
There is already an answer for doing this in Firefox but how do I do it in Chrome?
推荐答案
使用Web检查器(F12),转到元素选项卡,右键单击代码中的< html>
标记并选择复制
-> 复制externalHTML
。然后将其粘贴到新文件中并保存。
Using the Web Inspector (F12), go to the Elements tab, right click on the <html>
tag in your code and select Copy
->Copy outerHTML
. Then paste that into a new file and save.
这篇关于如何在Chrome中以当前状态转储整个Web DOM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!