mercredi 8 février 2017

Scraping text with XML

I am trying to scrape a text item from the following website: http://ift.tt/1engtVX The item I want to scrape is the "3B" from that follows "Position:" near the top of the web page. My attempt below only creates a empty dataset aka: character(0)

Any help is appreciated. Thanks.

url="http://ift.tt/2lrMPb8"       
  ret <- url %>%
        +   read_html() %>%
        +   html_nodes(xpath='//*[@id="content"]/table[1]/tbody/tr/td[1]/table/tbody/tr[1]/td/div[2]/text()[4]') %>%
        +   html_text()
    ret




Aucun commentaire:

Enregistrer un commentaire