无法通过javascript禁用html内容,并显示消息“请启用JavaScript以查看页面内容”。

时间:2015-07-30 04:04:49

标签: javascript jquery node.js

我正在使用node从url获取html页面的内容。这是我的代码:

request({
url     : url,
gzip    : true,
timeout : 2000
}, function(error, response, html){
   console.log(html); 
});

但是当我运行它时,某些网址会显示消息“请启用JavaScript以查看网页内容。”。我尝试谷歌很多东西,但仍然没有工作。我该如何解决?

ex url:http://www.barnesandnoble.com/blog/this-weeks-biggest-books/

1 个答案:

答案 0 :(得分:0)

Node.js抓取当前不处理Javascript,因此您只能检索无javascript数据,例如来自API的JSON对象等。希望能搞清楚!