title: Web scraping with R and rvest
body: <p>I am experimenting with <code>rvest</code> to learn web scraping with R. I am trying to replicate the Lego example for a couple of other sections of the page and using <code>selector gadget</code> to id.</p>
  
  <p>I pulled the example from <a href="http://blog.rstudio.org/2014/11/24/rvest-easy-web-scraping-with-r/" rel="nofollow">R Studio tutorial</a>. With the code below, 1 and 2 work, but 3 does not.</p>
  
  <pre><code>library(rvest)
  lego_movie &lt;- html("http://www.imdb.com/title/tt1490017/")
  
  # 1 - Get rating
  lego_movie %&gt;% 
    html_node("strong span") %&gt;%
    html_text() %&gt;%
    as.numeric()
  
  # 2 - Grab actor names
  lego_movie %&gt;%
    html_nodes("#titleCast .itemprop span") %&gt;%
    html_text()
  
  # 3 - Get Meta Score 
  lego_movie %&gt;% 
    html_node(".star-box-details a:nth-child(4)") %&gt;%
    html_text() %&gt;%
    as.numeric()
  </code></pre>