DEV Community

Cover image for @soblend/scraper
Soblend
Soblend

Posted on

@soblend/scraper

@soblend/scraper is a comprehensive collection of 13 robust and verified scrapers designed to extract data from various web sources. Each scraper is optimized for its specific use case, includes robust error handling, automatic retries, and a consistent API.

The library is built with a modular architecture, allowing you to import only the scrapers you need, reducing bundle size and improving your application's performance.

Instalation

npm install @soblend/scraper

Quick Start

`import { MetaDataFinder, CryptoPriceWatcher } from '@soblend/scraper';

const metaFinder = new MetaDataFinder();
const metadata = await metaFinder.scrape('https://example.com');
console.log(metadata.metadata.basic.title);
const crypto = new CryptoPriceWatcher();
const top10 = await crypto.getTopCryptos(10);
console.log(top10.cryptos);`

Available Scrapers

ImageCollector

A specialized scraper for downloading images from web pages with filtering capabilities by dimensions and format.

Use Cases:

Creating datasets for training AI models
Bulk downloading of wallpapers and images
Archiving web galleries

Configuration options:

{
timeout: 10000, // Maximum wait time per request (ms)
maxImages: 100, // Maximum number of images to extract
minWidth: 0, // Minimum width in pixels
minHeight: 0, // Minimum height in pixels
formats: ['.jpg', '.png'], // Accepted image formats
userAgent: 'custom-agent', // Custom user agent
retries: 3, // Number of retries in case of failure
downloadPath: './images' // Download path
}

You can read more about this library in our official repository: https://github.com/Soblend-Development/-soblend-scraper

Don't forget to give the repository a star and follow us =)

Top comments (0)