get-links
get links via dom selector
Project Status
Overview
Often you want to quick select links from a side which doesn't provide a API. For example you want to download all MP3 files from Podcast but normally have to click each link manually or something like that.
This is where get-links comes handy. You pass a URL and a DOM Selector and get in return an Array with all URL's found for your query.
A good starting point for further action ...
install with npm
npm install --save get-links
install with yarn
yarn add get-links
Example
ES5
var log =
ES6
Examples
// github have a api to request information (https://developer.github.com/v3/)// this is just an example how to use the npm module.// the github frontend may change over time so the example won't work anymore.////// functionality://// the main purpose of this script is to quick collect all links from// a given site via dom selectors.// its very useful to collect data from sites without an api. // get pinned repository links from githubconst url = 'https://github.com/ellerbrock'const selector = '.pinned-repo-item-content .d-block a'
Output should look like this:
Contact / Social Media
Get the latest News about Web Development, Open Source, Tooling, Server & Security
License
Copyright (c) 2016 Maik Ellerbrock