chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server={}'.format(proxy))
chrome_options.add_argument("user-agent={}".format(user_agent))
chrome_options.add_argument("load-extension={}".format(CANVAS_DEFENDER_PATH))
# disable images
prefs = {"profile.managed_default_content_settings.images": 2}
chrome_options.add_experimental_option("prefs", prefs)
if HEADLESS:
chrome_options.add_argument("--headless")
capabilities = {
"pageLoadStrategy": "none"
}
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver",
chrome_options=chrome_options, desired_capabilities=capabilities)