I\'m trying to use the rvest package to scrape data from a web page. In a simple format, the html code looks like this:
You can use xpath:
require(rvest)
text <- '
'
h <- read_html(text)
h %>%
html_nodes(xpath = '//*[@id="a"]') %>%
xml_attr("value")
The easiest way to get css- and xpath-selector is to use http://selectorgadget.com/. For a specific attribute like yours use chrome's developer toolbar to get the xpath as follows: