How do I extract certain html nodes using rvest?

I'm new to web-scraping so I may not be doing all the proper checks here. I'm attempting to scrape information from a url, however I'm not able to extract the nodes I need. See sample code below. In this example, I want to get the product name (Madone SLR 9 eTap Gen) which appears to be stored in the buying-zone__title class.

library(tidyverse)
library(rvest

url <- "https://www.trekbikes.com//us/en_US/bikes/road-bikes/performance-road-bikes/madone/madone-slr/madone-slr-9-etap-gen-7/p/37420"

read_html(url) %>% 
    html_nodes(".buying-zone__title") %>% 
    html_text()


When I run the code above, I get {xml_nodeset (0)} . How can I fix this? I would also like to scrape the year, price, available colors and specs from that page. Any help will be appreciated.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.