当需要获取Web页面上展示出的数据,而又没有现成的方法的时候,可以利用嵌入JS脚本的方式来获取整个页面的代码。
需要注意的是,不同的浏览器对JS脚本的支持情况不同。
function getAllCode_IE() { return document.documentElement.outerHTML; } function getAllCode_FireFox() { return document.body.innerHTML.toString(); }
当需要获取Web页面上展示出的数据,而又没有现成的方法的时候,可以利用嵌入JS脚本的方式来获取整个页面的代码。
需要注意的是,不同的浏览器对JS脚本的支持情况不同。
function getAllCode_IE() { return document.documentElement.outerHTML; } function getAllCode_FireFox() { return document.body.innerHTML.toString(); }