[R-SIG-Finance] get financial data from morningstar.com with rvest

Stefano spiovesan at alice.it
Sun Jan 24 22:41:21 CET 2016


Dear all,

I am trying to get financial data from morningstar.com; I want to get i.e.
MSFT yearly revenue data.

They are in a row `<div>`of a main `<div>` table.

I followed some samples to get the main table:



    url <-
"http://financials.morningstar.com/income-statement/is.html?t=MSFT&region=us
a&culture=en-US"

    table <- url %>%

     read_html() %>%

     html_nodes(xpath='//*[@id="sfcontent"]/div[3]/div[3]') %>%

     html_table()



but I get an empty `list()`. `html_nodes` itself returns a `{xml_nodeset
(0)}` that I don't know how to handle.



Best regards,

Stefano





---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list