Advanced Yellowpages Scraper avatar

Advanced Yellowpages Scraper

Try for free

3 days trial then $9.99/month - No credit card required now

View all Actors
Advanced Yellowpages Scraper

Advanced Yellowpages Scraper

dainty_screw/advanced-yellowpages-scraper
Try for free

3 days trial then $9.99/month - No credit card required now

Yellowpages Scraper is a robust tool designed to scrape business information from Yellowpages. It efficiently extracts essential details such as business names, addresses, phone numbers, categories, and more.

Yellow Pages Scraper

Yellow Pages Scraper is an Apify actor designed for scraping information from Yellow Pages listings. It allows you to search records based on a combination of search terms and location or a list of URLs. Built on top of the Apify SDK, it can be run both on the Apify platform and locally.

Table of Contents

Input

FieldTypeDescriptionDefault Value
searchstringQuery string to be searched on the site"Dentist"
locationstringLocation string to search the records in"Los Angeles"
startUrlsarrayList of Request objects that will be deeply crawled. The URL can be any Yellowpages.com record list pagenone
maxItemsnumberMaximum number of pages that will be scraped200
extendOutputFunctionstringFunction that takes a Cheerio object and a Cheerio representation of the record element ($, record) as arguments and returns data that will be merged with the default output. More information in Extend Output Function($, record) => { return {}; }
proxyConfigurationobjectProxy settings of the run. If you have access to Apify proxy, you can set { "useApifyProxy": true } to enable proxy usage{ "useApifyProxy": false }

Either the search and location attributes or the startUrls attribute must be set.

Output

Output is stored in a dataset. Each item contains information about a record.

1{
2    "name": "The Modern NYC",
3    "address": "9 W 53rd St, New York, NY 10019",
4    "phone": "(212) 333-1220",
5    "website": "https://www.themodernnyc.com",
6    "rating": 4.7,
7    "reviewSnippet": "A phenomenal dining experience with exquisite food and service. The best modern cuisine in NYC!",
8    "categories": [
9        "Restaurants",
10        "Fine Dining",
11        "American Cuisine"
12    ],
13    "url": "https://www.yelp.com/biz/the-modern-new-york"
14}

Please note that not all attributes will be present in all results.

Compute Units Consumption

Keep in mind that it is more efficient to run one longer scrape (at least one minute) than multiple shorter ones due to the startup time.

The average consumption is about 0.04 Compute Units per 2000 results scraped.

Extend Output Function

You can use this function to customize the default output of this actor. This function takes a Cheerio object and a Cheerio representation of the record element ($, record) as arguments, allowing you to add or modify attributes as needed. The output from this function will be merged with the default output.

The return value of this function must be an object!

You can return fields to achieve three different things:

  • Add a new field: Return an object with a field that is not in the default output.
  • Change a field: Return an existing field with a new value.
  • Remove a field: Return an existing field with a value of undefined.
1($, record) => {
2    return {
3        directionsLink: record.find('.directions').attr('href'),
4        rating: 5,
5        phone: undefined,
6    }
7}

This example will add a new field directionsLink, change the rating field, and remove the phone field.

Contact

For any questions or support, please contact us at support@example.com.


Connect With Us

Developer
Maintained by Community
Actor metrics
  • 10 monthly users
  • 6 stars
  • 97.6% runs succeeded
  • Created in May 2024
  • Modified about 2 months ago