title: Scraping multiple URLs in R using sapply
body: <p>Good afternoon,</p>
  
  <p>Thanks for helping me out with this question.</p>
  
  <p>I have a list of multiple URLs that I am interested in scraping for a specific field.</p>
  
  <p>At the moment, I'm using the function below to return the value I'm interested in for a specific field:</p>
  
  <pre><code>dayViews &lt;- function (url) {
    raw &lt;- readLines(url)
    dat  &lt;- fromJSON(raw)
    daily &lt;- dat$daily_views$`2014-08-14` 
    return(daily)
  }
  </code></pre>
  
  <p>How do I modify this to run on a list of multiple URLs? I tried using sapply/lapply over a list of URLs, but it gives me the following message:</p>
  
  <pre><code>"Error in file(con, "r") : invalid 'description' argument" 
  </code></pre>
  
  <p>If anyone has any suggestions, I would be greatly appreciative.</p>
  
  <p>Many thanks,</p>