From c6800ae5915fc6dcd99215b22217238a5e27a42e Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Wed, 19 Dec 2018 10:05:37 +0100 Subject: [PATCH] Add skipping HTTPS check --- lib/scanner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/scanner.py b/lib/scanner.py index 171889d..7d6815d 100644 --- a/lib/scanner.py +++ b/lib/scanner.py @@ -1,5 +1,7 @@ from requests import get from requests.exceptions import RequestException +from requests.packages import urllib3 +from urllib3.exceptions import InsecureRequestWarning from contextlib import closing from selenium import webdriver from selenium.webdriver.chrome.options import Options @@ -37,10 +39,13 @@ class Scanner: chrome_options.add_argument("--window-size=1920x1080") driver = webdriver.Chrome(chrome_options=chrome_options) + # Disable HTTPS request warnings + urllib3.disable_warnings(category=InsecureRequestWarning) + # Loop through all pages for url in self.urls: try: - with closing(get(url, stream=True)) as resp: + with closing(get(url, stream=True, verify=False)) as resp: if self.response_is_correct(resp): print("################################") print("INFO: Scraping {0}".format(url))