From e1559004fb5e6700c117befd12b8fb5afc0aafb8 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Mon, 18 Feb 2019 11:59:48 +0100 Subject: [PATCH] Add exception on numverify scan --- phoneinfoga.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index 916ad2e..0f3e1ad 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -291,9 +291,14 @@ def numverifyScan(): print(code_info + 'Running Numverify.com scan...') - requestSecret = '' - resp = requests.get('https://numverify.com/') - soup = BeautifulSoup(resp.text, "html5lib") + try: + requestSecret = '' + resp = requests.get('https://numverify.com/') + soup = BeautifulSoup(resp.text, "html5lib") + except: + print(code_error + 'Numverify.com is not available') + return -1 + for tag in soup.find_all("input", type="hidden"): if tag['name'] == "scl_request_secret": requestSecret = tag['value'] @@ -321,7 +326,7 @@ def numverifyScan(): data = json.loads(response.content.decode('utf-8')) except: - print(code_error + 'Numverify is not available') + print(code_error + 'Numverify.com is not available') return -1 if response.content == "Unauthorized" or response.status_code != 200: