npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

scrapper-x

v1.0.2

Published

A node js module to scrape data in json format from list like contents from webpages

Downloads

3

Readme

ScrapperX (scrapper-x) NPM module

scrapper-x is a node JS module which helps in gathering data from many websites. The module can gather data from websites having list like data formats.. (example : search results , User profile lists ,etc ) The output is a JSON containing all the required information specified in the configuration file .

#Installation npm install scrapper-x

#Usage

var sX = require('scrapper-x'); 
var request = require('request');

var config = {
  repeatItemGroup: '.searchCenterMiddle > li',
  dataFormat: {
    header: {
      selector: '.title',
      type: 'text'
    },
    link: {
      selector: '.title > a',
      type: 'attr:href'
    },
    description: {
      selector: '.compText',
      type: 'text'
    },
    customtext: 'haha'
  }
};


  request('https://in.search.yahoo.com/search?p=yo', function(error, response, body) {
    var scrappedResult = {};
    if (!error && response.statusCode == 200) {
      
      scrappedResult = sX.scrape(body, config);  //Simple scrape method that scrapes based on the config passed

    }
    console.log(scrappedResult);
  });

#Output

[
   {
      "header":"Yo - YouTube",
      "link":"http://www.youtube.com/user/Yo",
      "description":"Yo added to Favorites and liked 4 years ago 3:57. Play next; Play now;",
      "customtext": "haha"
   },
   {
      "header":"YO! Share and Connect without the Internet",
      "link":"https://www.yo.com/",
      "description":"YO! is the world's first 'Off-Grid' messaging, sharing and content discovery app.",
      "customtext": "haha"
   },
   {
      "header":"Yo | Define Yo at Dictionary.com",
      "link":"http://dictionary.reference.com/browse/yo",
      "description":"interjection 1. (used as an exclamation to get someone's attention, express excitement ",
      "customtext": "haha"
   },
   {
      "header":"Yo - Wikipedia, the free encyclopedia",
      "link":"http://en.wikipedia.org/wiki/Yo",
      "description":"Yo is an English slang interjection commonly associated with American English. ",
      "customtext": "haha"
   },
   {
      "header":"YouTube",
      "link":"http://www.youtube.com/",
      "description":"Share your videos with friends, family, and the world ",
      "customtext": "haha"
   },
   {
      "header":" Yo | Definition of yo by Merriam-Webster",
      "link":"http://www.merriam-webster.com/dictionary/yo",
      "description":"Full Definition of YO —used especially to call attention, to indicate attentiveness ",
      "customtext": "haha"
   },
   {
      "header":" Yo - definition of yo by The Free Dictionary",
      "link":"http://www.thefreedictionary.com/yo",
      "description":"yo (yō) interj. Slang. 1. Used as a greeting or to attract someone's attention. ",
      "customtext": "haha"
   },
   {
      "header":"Urban Dictionary: yo",
      "link":"http://www.urbandictionary.com/define.php?term=yo",
      "description":"1) How's yo momma? 2) Hey, yo! What's up, yo? 3) Yo! What the hell do you think",
      "customtext": "haha"
   },
   {
      "header":" Yo- yo - Wikipedia, the free encyclopedia",
      "link":"http://en.wikipedia.org/wiki/Yo-yo",
      "description":"A yo-yo competition normally consists of two parts, a set of ",
      "customtext": "haha"
   },
   {
      "header":" YO!Company - Simon Woodroffe's Innovation Hub",
      "link":"http://yo.co.uk/",
      "description":"The latest YO! Project: YO! Home.",
      "customtext": "haha"
   }
]