title: how to translate scraped text using google translator API
body: <p>I scraped a book off Project Gutenberg using beautiful soup in jupyter notebook, and want to translate it into another language. However, had trouble doing so.</p>
  <p>Would be grateful for help/advice; my code so far is below.The translation code did not work, and returned the following error &quot;WriteError: [Errno 32] Broken pipe&quot;</p>
  <pre><code>#Store url
  
  url = 'https://www.gutenberg.org/files/514/514-h/514-h.htm'
  html = r.text
  print(html)
  #Create a BeautifulSoup object from the HTML
  soup = BeautifulSoup(html, &quot;html5lib&quot;)
  type(soup)
  
  #get rid of non-text 
  
  paragraph=soup.find_all(&quot;p&quot;)
  for para in paragraph:
      print(para.text)
  
  #translate text using google API translator
  #init the Google API translator
  
  translator = Translator()
  translation = translator.translate(text,dest=&quot;ar&quot;)
  print(translation)
  </code></pre>