fix: Do not fail when getting the UA breaks

pull/79/head
Raphaël Vinot 2020-05-02 01:41:29 +02:00
parent 1f8750535e
commit 487222b81e
1 changed files with 7 additions and 1 deletions

View File

@ -139,7 +139,13 @@ def update_user_agents():
traceback.print_exc()
return
soup = BeautifulSoup(r.text, 'html.parser')
uas = soup.find_all('textarea')[1].text
try:
uas = soup.find_all('textarea')[1].text
except Exception:
traceback.print_exc()
return
to_store = {'by_frequency': []}
for ua in json.loads(uas):
os = ua['system'].split(' ')[-1]