title: Unable to scrape financial data off Morningstar using rvest and Selector Gadget
body: <p>First time trying to scrape some financial data off Morningstar's website.</p>
  
  <p>Specifically, I am trying to scrape the Free Cash Flow Per Share data for the following company: <a href="http://financials.morningstar.com/ratios/r.html?t=H78" rel="nofollow noreferrer">Hongkong Land Holdings</a></p>
  
  <p>I have used Selector Gadget to highlight the data which I want. The following screenshot shows what I have done.</p>
  
  <p><a href="https://i.stack.imgur.com/XBWg6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XBWg6.png" alt="Hongkong Land Selector Gadget"></a></p>
  
  <p>I tried using the following R script to get the Free Cash Flow per share data. However, the list that returns from the <code>html_nodes</code> function is a list of 0. I have tried using the css from Selector Gadget as well as the xpath. Both methods did not yield the desired result.</p>
  
  <pre><code>library(rvest)
  
  url &lt;- "http://financials.morningstar.com/ratios/r.html?t=H78"
  
  webpage &lt;- read_html(url)
  
  FCF_per_share &lt;- html_nodes(webpage, css = "#i90 , tr:nth-child(28) td, :nth-child(7) :nth-child(11) :nth-child(6) :nth-child(5) :nth-child(3) td:nth-child(4)")
  
  FCF_per_share &lt;- html_nodes(webpage, xpath = "//*[(@id = "i90")] | //tr[(((count(preceding-sibling::*) + 1) = 28) and parent::*)]//td//*[(((count(preceding-sibling::*) + 1) = 7) and parent::*)]//*[(((count(preceding-sibling::*) + 1) = 11) and parent::*)]//*[(((count(preceding-sibling::*) + 1) = 6) and parent::*)]//*[(((count(preceding-sibling::*) + 1) = 5) and parent::*)]//*[(((count(preceding-sibling::*) + 1) = 3) and parent::*)]//td[(((count(preceding-sibling::*) + 1) = 4) and parent::*)]")
  </code></pre>
  
  <p>I tried looking at my webpage variable above. It is a list of 2. When I tried to use the square brackets on the webpage variable, I am given the following results (am unsure what it means and whether is it correct):</p>
  
  <pre><code>webpage[[1]]
  &lt;pointer: 0x07928060&gt;
  webpage[[2]]
  &lt;pointer: 0x0778adc8&gt;
  </code></pre>
  
  <p>Help much appreciated. Thanks!</p>