如何获得完全计算的HTML(而不是源HTML)? [英] how to get fully computed HTML (instead of source HTML)?

查看:91
本文介绍了如何获得完全计算的HTML(而不是源HTML)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个使用大量javascript来生成HTML的网页,我怎样才能得到最终计算的HTML被浏览器而不是源HTML解析?换句话说,假定一个页面有很多围绕javascript函数的标签,当被调用时返回一些HTML。当我查看页面的源代码时,我看到脚本函数调用,而不是它产生的HTML。



我怎么能得到网页所产生的所有HTML?



我注意到Firebug出现能够看到HTML而不是脚本,但它似乎没有任何方法可以保存整个页面,只有一小段。



更新:



感谢所有的答案。然而,我仍然没有得到我在Firebug的控制台中看到的任何这些技术的HTML。对于我的示例页面,我使用自己的Facebook个人资料的信息标签。如果您在该页面上查看源代码,则会看到很多标题为big_pipe.onPageletArrive()的脚本。但是,如果您在Firebug中查看它,则每个函数调用都会呈现为HTML。我试图右键单击Firebug中的标记,Webdev工具栏中的View Generated Source和Chrome建议,但它们都给我脚本调用,而不是HTML。



其他想法?

更新2:

<当我说每个函数在Firebug中都呈现给HTML时,我并不完全正确。如果我在页面中选择它们并右键单击 - >检查元素,它们只会呈现出来。然后它似乎将它渲染出来。所以也许我的问题已经变成如何让Firebug自动渲染出所有的HTML,以便您可以选择并保存它? (或者我可以使用任何其他解决方案来获取此HTML)。

解决方案

使用Firebug的HTML选项卡,您可以右键单击在< html> 元素上,然后点击复制HTML。

你可以做同样的事情Chrome / Safari中的开发人员工具。


Given a webpage that uses lots of javascript to generate its HTML, how can I get the final computed HTML being parsed by the browser instead of the source HTML? In other words, presume a page has lots of tags surrounding javascript functions that, when called, return some HTML. When I view the source of the page, I see the script function call, not the HTML it produces.

How could I get all of the HTML produced by a webpage?

I've noticed that Firebug appears able to see the HTML instead of the scripts, but it doesn't appear to have any way to save the whole page, only little segments of it.

Update:

Thanks for all the answers. However, I'm still not getting the HTML I see in Firebug's console with any of those techniques. For my example page, I'm using the 'Info' tab of my own Facebook profile. If you view source on that page, you'll see lots of scripts with the title 'big_pipe.onPageletArrive()'. However, if you look at it in Firebug, each of those function calls renders out to HTML. I tried the right-click on the tag in Firebug, the View Generated Source in the Webdev Toolbar, and the Chrome suggestion, but they all give me the script call, not the HTML.

Any other ideas?

Update 2:

When I said each of those functions renders out to HTML in Firebug, I wasn't quite correct. They only render out if I select them in the page and right click->Inspect Element. Then it appears to render it out. So maybe my question has become how do you get Firebug to automatically render out all of the HTML so you can select and save it? (Or I'm open to any other solution for grabbing this HTML).

解决方案

With Firebug's HTML tab, you can right click on the <html> element, and click "Copy HTML".

You can do the same thing with Developer Tools in Chrome/Safari.

这篇关于如何获得完全计算的HTML(而不是源HTML)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆