knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", message = F )
The reviewscraper package allows users to scrape online reviews from Amazon, Trustpilot and Yelp.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("PeerChristensen/reviewscraper")
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.
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.