get-href-urls

1.0.1 • Public • Published

get-href-urls

CircleCI

NPM

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"]

Readme

Keywords

Package Sidebar

Install

npm i get-href-urls

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mrceephax