Using 'rvest' to extract links
<p>I am trying to scrape data from Yelp. One step is to extract links from each restaurant. For example, I search restaurants in NYC and get some results. Then I want to extract the links of all the 10 restaurants Yelp recommends on page 1. Here is what I have tried:</p>
<pre><code>library(rvest)     
page=read_html(&quot;http://www.yelp.com/search?find_loc=New+York,+NY,+USA&quot;)
page %&gt;% html_nodes(&quot;.biz-name span&quot;) %&gt;% html_attr('href')
</code></pre>
<p>But the code always returns 'NA'. Can anyone help me with that? Thanks!</p>