-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
21 lines (19 loc) · 974 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
def create_driver(chrome_driver_path):
chrome_options = Options()
chrome_options.binary_location = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
chrome_options.add_argument("user-data-dir=./user_data")
chrome_options.add_argument("--no-first-run")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--remote-debugging-port=9222")
chrome_options.add_argument("--no-default-browser-check")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
# chrome_options.add_argument("--headless")
service = Service(chrome_driver_path)
driver = webdriver.Chrome(service=service, options=chrome_options)
driver.implicitly_wait(10)
return driver