I am having trouble extracting the price element from the website:
"https://www.eventbrite.com/" using rvest
I have located the selector with Select Gadget and have the following minimal selector ".eds-l-mar-top-1" which I have used to locate the price. I have tried saving the xml data as a dataframe but I get the following error message:
Error in as.data.frame.default(page_html) : cannot coerce class ‘c("xml_document", "xml_node")’ to a data.frame
I have tried to filter the price with:
price <- page_html %>% html_nodes('js-display-price') %>% html_text()
but price is empty.
getYear = "2019"
getWeek = "31"
base_url = "https://www.eventbrite.com/"
query_params = list(yr=getYear, wk=getWeek)
resp <- GET(url=base_url, query=query_params)
page_html <- read_html(resp)
# price included in the details of the following tag
page_html %>%
html_nodes(".eds-l-mar-top-1") %>%
html_text(trim = TRUE)
I would like to extract the following data:
Name and Date of Event and price