This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out:
This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out:
Now we are going to get a little more advanced. This version gets the title of the article, as well as the heading for each image. Everything has been refactored into named functions so that the pieces are more reusable.
This is about as basic a crawler as you can get. Axios is a HTTP request library which behaves like the WHATWG standard Fetch (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), but works in both the client and the server. Cheerio brings jQuery-like DOM manipulation to the server.