如何在JavaScript中获取网页的所有内容或文本并存储在varible中 [英] How to get all content or text of webpage and store in on varible in JavaScript
本文介绍了如何在JavaScript中获取网页的所有内容或文本并存储在varible中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想得到网页的所有内容,首先我导航链接或只是定义链接,然后在一个变量中保存所有网页内容... plz帮我解决
I want to get all content of webpage which first i navigate link or just define link and after save all content of webpage in one varible...plz help me out
推荐答案
请看我对这个问题的评论。
现在,即使以下不是答案,这也是一个很好的思考: />
Please see my comment to the question.
Now, even if the following is not an answer, it would be a good food for thought:
// suppose you have some browser window object:
myWindow = // ...
// it could be a current window, or any other one
// then, all your content can be save in a variable:
myPageContent = myWindow.document; :-)
// if you window is the object of your current window,
// you don't need reference this window:
myCurrentPageContent = document; :-)
// "document" is the reference to some DOM object,
// comprehensively represented the page content
也许你需要不同的东西。太糟糕了,你没有真正解释你想要实现的目标。那么请澄清,但首先,请考虑这个简单的代码片段。 :-)
这篇关于如何在JavaScript中获取网页的所有内容或文本并存储在varible中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文