1

I'm making a Telegram bot with the node-telegram-api running on node.js. I want it to retrieve (scrape) client-side javascript values from a website.

The website is an online calendar (which data is stored in a javascript object) and the events are stored in this object's "events" attribute (which is an array).

How can node.js retrieve this array's values? In other words, can node.js "read" this website as a browser and retrieve the client-side javascript values of this website?

Thank you in advance for your help :)

4
  • Depends on how it puts the values in there. If it's a chunk of JS code inside a JS script block, probably ew. Commented Nov 12, 2015 at 18:54
  • It could be done with PhantomJS: stackoverflow.com/questions/18831098/… Commented Nov 12, 2015 at 19:06
  • Is that page rendering that objects or fetching them after page loaded? If it's rendering, your process is simple. Just make a request() to page and parse it using cheerio. Commented Nov 12, 2015 at 20:22
  • I suggest you this library github.com/lapwinglabs/x-ray Here is a list of web scraping packages: blog.webkid.io/nodejs-scraping-libraries Commented May 15, 2016 at 14:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.