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

yellow_pages_scraper

v1.2.6

Published

A business scraper for yellowpages.ca

Downloads

3

Readme

yellow_pages_scraper

yellow_pages_scraper is a web scraper that takes a phone number and returns the data from yellowpages.ca.

Notes

  • If there is multiple results for the phone number it will only return the first result.

Getting Started

npm install yellow_pages_scraper

Usage

Heres an example of how to use the module:

var { YellowPagesService } = require("yellow_pages_scraper");

(async () => {
  var yps = await new YellowPagesService();
  console.log(await yps.getYellowPagesData("+1705476 3373"));
})();

Phone Number Formatting

yellow_pages_scraper will automatically format the phone number to the correct format for yellowpages.ca. You can pass the phone number in any format and it will be converted to the correct format.

var { YellowPagesService } = require("yellow_pages_scraper");

(async () => {
  var yps = await new YellowPagesService();
  // All of these formats are valid
  console.log(await yps.getYellowPagesData("705-476-3373"));
  console.log(await yps.getYellowPagesData("705 476 3373"));
  console.log(await yps.getYellowPagesData("+1705476 3373"));
  console.log(await yps.getYellowPagesData("1-705-476-3373"));
})();

Output

Heres an example of the output you can expect from the module:

{
  "number": "+1705476 3373",
  "success": true,
  "data": {
    "itemType": "Restaurant",
    "image": "https://cdn.ci.yp.ca/t/1550/83/15508336aa_t.gif",
    "url": "https://www.yellowpages.ca/bus/Ontario/North-Bay/Casey-s-Bar-Grill/317738.html",
    "name": "Casey's Bar & Grill",
    "address": "20 Maplewood Ave, North Bay, ON P1B 5H2",
    "streetAddress": "20 Maplewood Ave",
    "addressLocality": "North Bay",
    "addressRegion": "ON",
    "postalCode": "P1B 5H2",
    "telephone": "705-476-3373",
    "description": "You'll feel right at home at Casey's Bar & Grill in Ontario. Our menu is filled with all your favorites and our staff is known for making you feel like a beloved guest in our home. Come in and dine with us. We can serve up a variety of foods for fans of any type, from tacos and quesadillas to pasta, burgers, and more. Come in and relax while our staff welcomes you and treats you to our famous friendly attitude. We build a friendly environment that’s good for the whole family. We have locations all over, in North Bay, Kenora, London, L’Acadie, and many other places in Ontario and Quebec, so you can enjoy our tasty menu wherever you are. Book a reservation or come in and enjoy a great meal today....",
    "servesCuisine": "Fusion Cuisine,",
    "openingHours": "11:00 am - 1:00 am",
    "aggregateRating": "11 ratings & 11 reviews",
    "ratingValue": "3.6",
    "ratingCount": "11",
    "reviews": [
      {
        "ratingValue": "3",
        "author": "Restaurantica12",
        "datePublished": "January 4, 2009",
        "name": "Good food, however if they put you at the bar to...",
        "reviewBody": "Good food, however if they put you at the bar to eat good luck in getting any quality service.  It appears the bartenders are the servers and they don't seem the least bit interested to serve people food, nobody sticks to one table.  This is not the first time this has happened.  Next time I'll maybe wait the extra 30 minutes to get a dining room seat."
      },
      ...
    ],
    "website": "https://www.caseysnorthbay.com/",
    "socialMedia": {
      "facebook": "https://www.facebook.com/northbaycaseys/",
      "twitter": "",
      "instagram": "",
      "linkedin": "",
      "youtube": "",
      "pinterest": ""
    }
  }
}

If the page is not found the success field will be set to false and it output something like this:

{ "number": "604-484-6010", "success": false, "error": "No results found" }

Creator