scrape_yelp: Get Business Names & Addresses from Yelp

View source: R/web_scraping.R

scrape_yelpR Documentation

Get Business Names & Addresses from Yelp

Description

To support the Ottawa Neighbourhood Study in refreshing its food availability database, this function does a perfunctory Yelp search for a given term in a given location.

Usage

scrape_yelp(search_term, location = "Ottawa, ON", num_pages = 24)

Arguments

search_term

Character string to search Yelp for.

location

Character string containing the location to search. Defaults to "Ottawa, ON".

num_pages

The number of pages to search. Defaults to 24.

Details

Results include business names and addresses. This function could be improved but it works for what we need now, and Yelp is very protective of its data. Be warned that scraping too much too quickly may get your IP address blocked.

Value

A tibble with Yelp search results.

Examples

## Not run: 
convenience_stores <- scrape_yelp("convenience stores")

## End(Not run)

Ottawa-Neighbourhood-Study/onsr documentation built on June 19, 2022, 11:46 a.m.