This program is a very simple, straight to the point, command line web scrapper written in NodeJS.
The application takes two parameters:
- the URL to visit
- the selector to apply (for instance
.storylink
or.title
)
On the shell type the following:
node index.js <URL> <SELECTOR>
This will display all the retrieved items and the closest link.
To retrieve a list of top hackernews stories type the following:
node index.js "https://news.ycombinator.com/best" ".storylink"
To retrieve the titles and associated link to the articles of The Guardian, type:
node index.js "https://www.theguardian.com/uk" "a.js-headline-text"
To use the program you need to:
- Install NodeJS
- Clone this repository
- Install the dependencies
- Run the program