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