Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
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):
|