cna-scraper
v1.0.3
Published
Easy scraper for Channel News Asia articles
Downloads
14
Maintainers
Readme
CNA-Scraper
Easy to use JS scraper for Channel News Asia articles.
Installation
Use the package manager npm to install cna-scraper.
npm install cna-scraper
Usage
const cnascraper = require('cna-scraper');
cnascraper.ScrapeArticle('CNA ARTICLE URL HERE', function(err, ArticleData){
console.log(ArticleData) //logs entire article data object
console.log(ArticleData.title) //logs article title
console.log(ArticleData.category) //logs article ctegory
console.log(ArticleData.text) //logs article text
console.log(ArticleData.postdate) //logs article post date
console.log(ArticleData.img) //logs image source (parsed for you)
console.log(ArticleData.imgcaption) //logs article image caption
console.log(ArticleData.source) //logs article source
});
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to test before making pull requests.