Skip to content
Prev 13683 / 15274 Next

get financial data from morningstar.com with rvest

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