Update selescrape.py

master
Arjix 2020-10-18 18:51:09 +03:00 committed by GitHub
parent 8cb3a8dfb0
commit 924d84499c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -145,6 +145,8 @@ def driver_select():
service_log_path=os.path.devnull)
elif browser == 'chrome':
profile_path = os.path.join(data_dir, 'Selenium_chromium')
log_path = os.path.join(data_dir, 'chromedriver.log')
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
ops = ["--headless", "--disable-gpu", '--log-level=OFF', f"--user-data-dir={profile_path}",
@ -152,9 +154,6 @@ def driver_select():
for option in ops:
chrome_options.add_argument(option)
profile_path = os.path.join(data_dir, 'Selenium_chromium')
log_path = os.path.join(data_dir, 'chromedriver.log')
if not binary:
if not executable:
driver = webdriver.Chrome(options=chrome_options)