I am trying to perform a webscrape using rvest to scrape data on a specific product category from a webshop. The product results are displayed across multiple webpages. When i use my code i only get the first 24 results which is equal to the products on the first page. How can I adjust my code to scrape across all results pages?
Thanks in advance!
url_bol <- 'https://www.bol.com/nl/l/lichtbronnen/N/14483'
webpage_bol <- read_html(url_bol,na.strings=" ",header=TRUE)
head(webpage_bol)
product_title_data_html <- html_nodes(webpage_bol, '.product-title')
product_title_data <- html_text(product_title_data_html)
head(product_title_data)
product_title_data<-gsub("\n","",product_title_data)
product_title_data<-gsub(" ","",product_title_data)
head(product_title_data)
length(product_title_data)
product_brand_data_html <- html_nodes(webpage_bol, '.product-creator')
product_brand_data <-html_text(product_brand_data_html)
head(product_brand_data)
product_brand_data<-gsub("\n","",product_brand_data)
product_price_data<-gsub(" ","",product_price_data)
head(product_brand_data)
length(product_brand_data)
product_price_data_html <- html_nodes(webpage_bol, '.promo-price')
product_price_data <- html_text(product_price_data_html)
head(product_price_data)
product_price_data<-gsub("\n","",product_price_data)
product_price_data<-gsub(" ","",product_price_data)
head(product_price_data)
product_price_data
length(product_price_data)
bol.df <- data.frame(Procuct_title = product_title_data, Brand = product_brand_data, Price = product_price_data)
View(bol.df)