From 487222b81e019e80693e3cd67a759cfcbb076a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sat, 2 May 2020 01:41:29 +0200 Subject: [PATCH] fix: Do not fail when getting the UA breaks --- lookyloo/helpers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lookyloo/helpers.py b/lookyloo/helpers.py index 84efb839..e0afc27c 100644 --- a/lookyloo/helpers.py +++ b/lookyloo/helpers.py @@ -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]