프로젝트
GitHub에서 보기
wrtnlabs/web-content-extractor
소개
A LLM-free library for extracting main content from HTML strings via Text Density analysis
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalweb-content-extractor
A small and fast library for extracting content from HTML.
It is an one of implementation of the paper DOM Based Content Extraction via Text Density.
Installation
To install via NPM:
npm i @wrtnlabs/web-content-extractor
Usage
import { extractContent } from "@wrtnlabs/web-content-extractor";
const { title, description, content, contentHtmls, links } =
extractContent(html);
console.log("title", title);
console.log("description", description);
console.log("content", content); // The content of the page; string
for (const fragment of contentHtmls) {
console.log("fragment", fragment); // The fragment of the content; string
}
for (const link of links) {
console.log("url", link.url); // The URL of the link
console.log("content", link.content); // The content of the link
}
Note
It strips some tags that can be considered as non-content tags, including:
scriptnoscriptstylenavheaderfooterimgsvgvideoaudioformlabelinputselectoptionbuttonobjectembediframecanvasmaparea
관련 프로젝트 살펴보기
불러오는 중…