I am trying to scrape some data off a shoe website called footlocker.com I have the following code, where I am trying to extract the number of 'xyz' brand shoes on sale and the total number of those shoes.
library(rvest)
webpage <-
read_html("https://www.footlocker.com/category/brands/adidas.html?
query=adidas%3Arelevance%3AproductType%3A200005")
webpage
#Using CSS selectors to scrape the sale section
sale_count_html <- html_nodes(webpage, 'li:nth-child(1) .miscellaneous
.count')
sale_count <- html_text(sale_count_html)
sale_count <- as.numeric(sale_count)
head(sale_count)
total_count_html <- html_nodes(webpage,'strong+ strong')
total_count <- html_text(total_count_html)
head(total_count)
It is giving me character(0) for sale_count whereas on the website it is a 3 digit number. And for total_count, it is giving me a totally different number than what is on the website