0

I'm using node to get content of html page from url. Here is my code:

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

But some of url when I run it appear message "Please enable JavaScript to view the page content.". I'm try google a lot of thing but still not yet work. How can I fix it?

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

3
  • try visiting that page with javascript disabled in your browser - that's how node will get the page Commented Jul 30, 2015 at 4:10
  • @JaromandaX It's is a blank page with message "Please enable JavaScript to view the page content." Commented Jul 30, 2015 at 4:26
  • exactly, so your scraping is doing what it should Commented Jul 30, 2015 at 5:14

1 Answer 1

0

Node.js scraping currently does not process Javascript and so you can only retrieve javascript-less data, such as JSON objects from APIs and such. Hope that clears things up!

Sign up to request clarification or add additional context in comments.

1 Comment

Can someone please tell me why this was downvoted? I ask because I want to learn.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.