From ceef3652f78a08f737501377007447f382ff51ab Mon Sep 17 00:00:00 2001 From: "borja.sorazu" Date: Fri, 13 Sep 2019 12:40:15 +0100 Subject: [PATCH] further work on capturing network exceptions --- detector_monitorv2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/detector_monitorv2.py b/detector_monitorv2.py index 2b7d4fd..66693e0 100644 --- a/detector_monitorv2.py +++ b/detector_monitorv2.py @@ -14,9 +14,12 @@ def statusdetect(): r =requests.get(url) except: print ('ERROR: Issues requesting website: ' + url + '\n') + r='' pass - - soup = BeautifulSoup(r.text,"lxml") + if hasattr(r, 'text'): + soup = BeautifulSoup(r.text,"lxml") + else: + soup = BeautifulSoup(r,"lxml") names = ['GEO 600','LIGO Hanford','LIGO Livingston','Virgo','KAGRA'] detrows = [] to_add=[] -- GitLab