title: Configure random proxies with R for scraping
body: <p>I scraped a website authorizing scraping in robots rules but sometimes I get blocked.</p>
  
  <p>While I contacted the admin to understand why, I want to understand how I can use different proxies within R to keep on scraping without being blocked.</p>
  
  <p>I followed this quick tutorial:
  <a href="https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy" rel="nofollow noreferrer">https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy</a></p>
  
  <p>So I edited the environment file:</p>
  
  <pre><code>file.edit('~/.Renviron')
  </code></pre>
  
  <p>and within this I inserted a list of proxies to be selected randomly:</p>
  
  <pre><code>proxies_list &lt;- c("128.199.109.241:8080","113.53.230.195:3128","125.141.200.53:80","125.141.200.14:80","128.199.200.112:138","149.56.123.99:3128","128.199.200.112:80","125.141.200.39:80","134.213.29.202:4444")
  proxy &lt;-paste0('https://', sample(proxies_list, 1))
  https_proxy=proxy 
  </code></pre>
  
  <p>But when I scrape with this code:</p>
  
  <pre><code>download.file(url_proxy, destfile ='output.html',quiet = TRUE)
  html_output &lt;- read_html('output.html')
  </code></pre>
  
  <p>I keep being blocked.</p>
  
  <p>Am I not setting the proxies correctly?</p>
  
  <p>Thanks !
  M.</p>