get-href-urls
v1.0.1
Published
[![CircleCI](https://circleci.com/gh/mrceephax/get-href-urls/tree/master.svg?style=svg)](https://circleci.com/gh/mrceephax/get-href-urls/tree/master)
Downloads
2
Readme
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"]