auto_login_EIP/utils/driver.py

17 lines
548 B
Python

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.webdriver import WebDriver
def get_driver() -> WebDriver:
service = Service(executable_path='./chromedriver.exe')
options = webdriver.ChromeOptions()
# options.add_argument("--headless")
options.add_argument('--disable-gpu')
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(service=service, options=options)
driver.implicitly_wait(4)
return driver