Yaron Koresh commited on
Commit
44eb51d
·
verified ·
1 Parent(s): cd96b6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -27,7 +27,7 @@ else:
27
  def translate(text,lang):
28
  html_str = requests.get( url = "https://translate.google.com", params = {"sl": "auto", "tl": lang, "op": "translate", "text": text} ).text
29
  tree = fromstring(html_str)
30
- translated = tree.xpath('span[lang="'+lang+'"]/span/span/text()')[0]
31
  return translated
32
 
33
  def generate_random_string(length):
 
27
  def translate(text,lang):
28
  html_str = requests.get( url = "https://translate.google.com", params = {"sl": "auto", "tl": lang, "op": "translate", "text": text} ).text
29
  tree = fromstring(html_str)
30
+ translated = tree.xpath('//span[@lang="'+lang+'"]/span/span/text()')[0]
31
  return translated
32
 
33
  def generate_random_string(length):