sri-lanka-news-scraper
v1.0.0
Published
A Puppeteer stealth utility to scrape popular Sri Lankan news outlets.
Maintainers
Readme
📰 sri-lanka-news-scraper
A powerful high-performance Sri Lankan news scraping framework built with Puppeteer Extra + Stealth Plugin for bypassing bot protections and extracting structured news data from major Sri Lankan media platforms.
✨ Features
🛡️ Advanced Stealth Protection
Usespuppeteer-extra-plugin-stealthto bypass anti-bot systems and automation detection layers.⚡ High-Speed Extraction Engine
Optimized browser execution pipelines with efficient DOM parsing strategies.📰 Multi News Provider Support
Supports multiple major Sri Lankan news platforms out of the box.🔄 Dynamic Selector Recovery
Automatically falls back to resilient selectors when layouts shift.🧠 Smart Content Parsing
Extracts:- Title
- Date
- Image
- URL
- Full article content
🌐 Cloudflare Compatible
Handles dynamically rendered pages and delayed verification systems.
🏢 Supported News Providers
| Provider | Function |
|---|---|
| Hiru News | scrapeHiruNews() |
| NewsFirst | scrapeNewsFirst() |
| Ada Derana | scrapeAdaDerana() |
| Dasatha Lanka News | scrapeDasathaNews() |
| Lankadeepa | scrapeLankadeepa() |
| Divaina | scrapeDivaina() |
| Ada.lk | scrapeAda() |
| Daily Mirror | scrapeDailyMirror() |
📥 Installation
npm install sri-lanka-news-scraper
📈 Example code Search
const {
scrapeHiruNews,
scrapeNewsFirst,
scrapeAdaDerana,
scrapeDasathaNews,
scrapeLankadeepa,
scrapeDivaina,
scrapeAda,
scrapeDailyMirror
} = require('sri-lanka-news-scraper');
async function run() {
try {
console.log("Launching stealth scraping engine...\n");
// Example: Hiru News
const hiru = await scrapeHiruNews();
console.log("========== HIRU NEWS ==========");
console.log(JSON.stringify(hiru, null, 2));
} catch (error) {
console.error("Scraper pipeline failed:", error.message);
}
}
run();📈 Output Search
{
"title": "Breaking News Headline",
"date": "2026-05-23",
"image": "https://news-site/image.jpg",
"url": "https://news-site/article-link",
"insideDescription": "Full article content extracted successfully..."
}