
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
My News Scraper - Scrape sites for groups of articles
// require the library
var mns = require( 'mns' );
// initialize the scraper with the options for the website
// you want to get news from.
// example for Hacker News
var scraper = mns({
url : "http://news.ycombinator.com/news",
type : "text/html",
selectors : {
// a CSS selector that gathers every article you want to scrape
list : "td:not([align]).title",
// a CSS selector for each property you want to gather from
// the article listing (relative to the listSelector)
article : {
// you can pass an object with keys
// selector and attr. In this case, it specifies that
// you want to gather the href attribute from the "a"
// selector
url : {
selector : "a",
attr : "href"
},
// or simply a CSS selector that's relative to the
// listSelector which you specified before
src : "span",
title : "a"
}
}
});
// execute the scraping itself
scraper.execute(function( err, items ) {
if ( err ) {
return console.log( err );
}
// do something with the items array.
// every item in the array has the properties you
// passed in the article selector object previously.
// In this case, this means you'll get an object with
// properties url, title and src.
});
Some website configurations reside in test/files/sitesToScrape.json
This is still a work in progress, under active development. At the moment, the library is in alpha stage, providing very basic functionality. If you have any question, feel free to open an issue on this repository.
FAQs
My News Scraper - Scrape sites for groups of articles
The npm package mns receives a total of 3 weekly downloads. As such, mns popularity was classified as not popular.
We found that mns demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.