knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  message = F
)

reviewscraper

The reviewscraper package allows users to scrape online reviews from Amazon, Trustpilot and Yelp.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("PeerChristensen/reviewscraper")

Example 1: Reviews of Snoop Doggs cookbook on Amazon

library(reviewscraper)

snoop_url <- "https://www.amazon.com/Crook-Cook-Platinum-Recipes-Kitchen/product-reviews/1452179611/ref=cm_cr_dp_d_show_all_btm?ie=UTF8&reviewerType=all_reviews"

from_crook_to_cook <- get_reviews(base_url = snoop_url, page_lim = 2, source = "amazon", verbose=T)

head(from_crook_to_cook)

Alternatively, you can use the get_amazon_reviews() function and leave out the source argument. Use the page_lim argument to choose the number of pages to scrape.

Example 2: Reviews of Osteria dell'Orsa in Bologna from Yelp

PLease note that recent changes may affect review data scraped from Yelp. I might try to fix such issues in the future.

orsa_url <- "https://www.yelp.com/biz/osteria-dellorsa-bologna?osq=orsa"

orsa <- get_reviews(base_url = orsa_url, page_lim = 2, source = "yelp")

# ..or use get_yelp_reviews()


PeerChristensen/reviewscraper documentation built on Dec. 18, 2021, 6:46 a.m.