Hello,
I am new to web scraping via the package "rvest."
Code below shows that I am able to scrape the title of the post successfully.
However, when I look to scrape the headings of various stories on the page,
the program returns "xml_nodeset."
When I originally scraped this page, this code worked fine. Any ideas to ensure that the scrape will run succesfully as stories change day to day?
library(rvest)
reddit_political_webpage<- read_html("https://www.reddit.com/r/politics/")
reddit_political_webpage %>%
html_node("title") %>%
html_text()
#> [1] "Politics"
reddit_political_webpage %>%
html_nodes("#t3_p164nk ._eYtD2XCVieq6emjKBH3m , #t3_p190o4 ._eYtD2XCVieq6emjKBH3m, #t3_p14fxj ._eYtD2XCVieq6emjKBH3m")
#> {xml_nodeset (0)}