title: R Web Scraping 'Failed to load HTTP Resource' with XML
body: <p>I have created a function to scrape statistics from individual soccer match reports. I am usually able to use this to scrape stats from hundreds of matches at a time without a problem. However for the past week I have been away visiting family for the holidays cannot run my code at all without receiving the message:</p>
  
  <pre><code>Error: failed to load HTTP resource
  </code></pre>
  
  <p>I thought this was just my parents poor internet connection but I am now having the same problem wherever I go around the country!</p>
  
  <p>My code starts with creating a vector of match codes for each game:</p>
  
  <pre><code>matchid &lt;- c(369835, 369842, 369839, 369836, 369834, 369841)
  </code></pre>
  
  <p>My function is currently as below:</p>
  
  <pre><code>GetStats &lt;- function(matchid){
  Stats &lt;- NULL
  for(i in matchid){
  urli &lt;- paste("http://www.espnfc.co.uk/gamecast/statistics/id/", i, "/statistics.html", sep="")
  datai &lt;- readHTMLTable(urli)
  hometeami &lt;- datai[[1]]
  awayteami &lt;- datai[[2]]
  hometeami &lt;- hometeami[1:11,]
  awayteami &lt;- awayteami[1:11,]
  matchdatai &lt;- rbind(hometeami, awayteami)
  matchdatai$match_id &lt;- i
  matchdatai &lt;- matchdatai[c(14, 1:13)]
  Stats &lt;- rbind(Stats, matchdatai)}
  return(Stats)
  }
  </code></pre>
  
  <p>I then run my function on my individual match codes:</p>
  
  <pre><code>MatchStats &lt;- GetStats(matchid)
  View(MatchStats)
  </code></pre>
  
  <p>But it is at this point that I am now receive the error message.</p>
  
  <p>Could someone please help me by helping me understand what might be causing this? As far as I can see nothing has changed in the websites I am trying to scrape. Is it something caused by the internet connections I am now using? Is there a simple fix I can add in to my code to overcome this?</p>
  
  <p>As mentioned, I am able to run this on hundreds of matches at once on my own connection at my flat so I am very confused!</p>
  
  <p>Thank you in advance</p>