html-link-extractor

extracts links from html text

MIT 6 个版本
安装
npm install html-link-extractor
yarn add html-link-extractor
pnpm add html-link-extractor
bun add html-link-extractor
README

html-link-extractor

Extracts links from html texts.

Installation

$ npm install --save html-link-extractor

API

htmlLinkExtractor(html)

Parameters:

  • html text in html format.

Returns:

  • an array of URLs

Examples

const { readFileSync } = require('fs');
const htmlLinkExtractor = require('html-link-extractor');

const html = readFileSync('index.html', {encoding: 'utf8'});

const links = htmlLinkExtractor(html);
links.forEach(link => console.log(link));

Testing

npm test

License

See LICENSE.md

版本列表
1.0.5 2022-05-04
1.0.4 2022-05-04
1.0.3 2022-05-04
1.0.2 2022-05-04
1.0.1 2022-05-04
1.0.0 2022-04-24