المشاريع
عرض على GitHub
wrtnlabs/web-content-extractor
حول
A LLM-free library for extracting main content from HTML strings via Text Density analysis
تطوير الويب والتطبيقاتالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- -٢
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلweb-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
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…