From 7c7c016e2776a7ee9d90adbcfb97336a9d05550d Mon Sep 17 00:00:00 2001 From: Thomas Wade Date: Mon, 17 Sep 2018 23:55:18 +0930 Subject: [PATCH] Disable image loading --- scrape.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrape.py b/scrape.py index 31a8aa4..69a51de 100755 --- a/scrape.py +++ b/scrape.py @@ -25,6 +25,10 @@ print('NetworkX initialised') chrome_options = Options() chrome_options.add_argument('--headless') # Start headless so we can run on a server overnight +# Disable image loading, courtesy of rocky qi +# Found at https://stackoverflow.com/a/31581387, accessed on 2018/09/17 at 12:54 UTC +chrome_options.add_experimental_option("prefs", {"profile.managed_default_content_settings.images":2}) + driver = webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, chrome_options=chrome_options) print('WebDriver initialised')