Skip to content
🤔一个新闻网页正文通用抽取器,包括标题、作者和日期。online: https://general-news-extractor-demo.stayin.cn
TypeScript
Branch: master
Clone or download
Latest commit 99ae8b8 Oct 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo chore: update demo package Oct 4, 2019
src
test chore: update test Oct 4, 2019
tools chore:init Oct 3, 2019
.editorconfig chore:init Oct 3, 2019
.gitattributes chore: add gitattributes Oct 9, 2019
.gitignore chore: update build Oct 4, 2019
.travis.yml chore:init Oct 3, 2019
LICENSE Initial commit Oct 3, 2019
README.md docs: update readme Oct 9, 2019
package.json chore: update package Oct 4, 2019
rollup.config.ts chore: update build Oct 4, 2019
tsconfig.json chore:init Oct 3, 2019
tslint.json chore:init Oct 3, 2019
yarn.lock chore: update build Oct 4, 2019

README.md

general-news-extractor

一个新闻网页正文通用抽取工具,还有标题、作者和发布日期。

该项目启发自kingname/GeneralNewsExtractor,由 Python 迁移到 Node.js ,并做了一些改动,提高提取准确度。

Online DEMO

https://general-news-extractor-demo.stayin.cn/

Installation

Using npm:

npm i general-news-extractor

Usage

const GeneralNewsExtractor = require('general-news-extractor')

const htmlString = `` // HTML for a news page

const gne = new GeneralNewsExtractor()

// gne.extract( html: string, { titleSelector = '', authorSelector = '', dateTimeSelector = '', noiseNodeList = [] } = {})
const result = gne.extract(htmlString, {})

TODO

  • Run in browser

Thanks

License

MIT © zenghongtu

You can’t perform that action at this time.