get-href-urls
A utility tool for find all urls in an html page, that are inside an anchor tag.
Example matches:
MyWebPage.html
<a href="https://theverge.com">theverge.com</a>
To find links:
const getHrefUrls = require("get-href-urls");
const fs = require("fs");
fs.readFile("./MyWebPage.html", "utf8", function (err,data) {
if (err) {
return console.log(err);
}
const urls = getHrefUrls(data);
// output: ["https://theverge.com"]
});
Using in the command line:
curl "https://www.theverge.com" | get-href-urls
// output: ["https://theverge.com"]