Yaron Koresh commited on
Commit
e0d59c8
·
verified ·
1 Parent(s): 93b8891

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -39,7 +39,7 @@ def translate(text,lang):
39
  headers = {'User-Agent': random.choice(user_agents)}
40
  ).text
41
  tree = etree.HTML(html_str)
42
- translated = tree.xpath(f'//span[@lang="{lang}"]/span/span[text()]')
43
  return translated
44
 
45
  def generate_random_string(length):
 
39
  headers = {'User-Agent': random.choice(user_agents)}
40
  ).text
41
  tree = etree.HTML(html_str)
42
+ translated = tree.xpath(f'//span[@lang="{lang}"]/span/span[text()]')[0].text.strip()
43
  return translated
44
 
45
  def generate_random_string(length):