使用 Nodejs 进行抓取页面的时候,js 等都可以运行,但是页面中包含一个 iframe,输出抓取的 html 的时候,iframe 中是空的,没有 dom。用的包是 Node-phantomjs。
1
xycool 2018 年 2 月 25 日
phantomjs --web-security=no 试试
|
2
lemuria 2018 年 2 月 25 日
document.querySelector('selector').contentWindow.document.documentElement.outerHTML
|
3
lemuria 2018 年 2 月 25 日
|
4
gongcheng121 OP @lemuria ok,我试试,谢谢
|