- 通过
outerHTML
document.documentElement.outerHTML
- 通过异步请求(完整源码,推荐)
$.get(window.location.href,function(res){ console.log(res); });
- 通过jQuery
$("html").html();
js获取当前网页的源码
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
JS宠物游戏源码
js宠物游戏源码 内置对象
JS 宠物游戏 -
JS python 网页源码 python获取网页源码
爬虫,就是用程序代替人去访问网站,然后把网站上需要的东西拿下来;类似人输入网址,看到页面,然后复制粘贴,只是把这个过程自动化。那么第一步就是去访问网站,要看到网站的页面,对程序来说也就是源码。笔者在学爬虫时曾被这一步卡了挺久;想爬知乎,但查了不少资料,大多是说怎么解析源码的,怎么从源码中定位需要的内容;但源码从哪来呢?源码不过就是字符串,总会有工具能提取的,是在不行自己写工具也行;但对于高手们来说
JS python 网页源码 python源码 python爬虫源码 python获取网页源码不完整 复制下来的源码打不开