Skip to content

Package for scraping information from different blogging websites.

Notifications You must be signed in to change notification settings

brombaut/article-scraper

Repository files navigation

Article Scraper

CI npm Codecov

Package for scraping information from different blogging websites.

✅ Currently supported sites

🚧 Planned sites to support:

Installing

For the latest version:

npm i article_scraper

Usage

import { ArticleMetaData, ArticleScraper } from "article_scraper";

const url = "https://dev.to/ashish9342/commenting-code-good-practices-3d23";
const scraper: ArticleScraper = new ArticleScraper(url);
await scraper.scrape();
const result: ArticleMetaData = scraper.articleMetaData();

The ArticleMetaData result will contain information about the article in the following format. Any errors encountered during scraping will be added to the errors attribute.

ArticleMetaData {
  title: 'Commenting Code | Good Practices',
  minuteRead: 3,
  tags: [
    {
      name: '#programming',
      href: 'https://dev.to/t/programming',
      color: '#ffffff',
      backgroundColor: '#890606'
    },
    {
      name: '#javascript',
      href: 'https://dev.to/t/javascript',
      color: '#000000',
      backgroundColor: '#F7DF1E'
    },
    {
      name: '#codequality',
      href: 'https://dev.to/t/codequality',
      color: '#000000',
      backgroundColor: '#e5fffd'
    },
    {
      name: '#productivity',
      href: 'https://dev.to/t/productivity',
      color: '#C8F7C5',
      backgroundColor: '#2A0798'
    }
  ],
  url: 'https://dev.to/ashish9342/commenting-code-good-practices-3d23',
  errors: []
}

About

Package for scraping information from different blogging websites.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published