title: Error with getURL function in r
body: <p>I am trying to automatically translate a text from different language to English.</p>
  
  <p>i am doing the passages explained on this other question: <a href="https://stackoverflow.com/questions/46551298/google-translate-via-web-scraping-r">Google translate via web scraping r</a></p>
  
  <p>but I obtain this error:</p>
  
  <pre><code>Error in function (type, msg, asError = TRUE)  :  Illegal characters found in URL
  </code></pre>
  
  <p>my code is</p>
  
  <pre><code> getParam &lt;- as.character(db$text) 
   translateFrom &lt;- as.character(db$language)
  
   translateTo &lt;- "en"  
   search &lt;- gsub(" ", "%20", getParam) 
   URL &lt;- paste("https://translate.google.pl/m?hl=",translateFrom,"&amp;sl=",translateFrom,"&amp;tl=",translateTo,"&amp;ie=UTF-8&amp;prev=_m&amp;q=",search,sep="", ssl.verifypeer = FALSE)
  
   page &lt;- getURL(URL)  
  
   tree &lt;- htmlTreeParse(page)
  
   body &lt;- tree$children$html$children$body 
  </code></pre>