Note the frequently used options in Python + Selenium + Chrome
from selenium import webdriver
options = webdriver.chrome.options.Options()
#Hide screen
options.add_argument('--headless')
#Seems essential
options.add_argument('--disable-gpu')
#Size specification
options.add_argument('--window-size=1920,1080')
#Avoiding lack of authority of container
options.add_argument('--no-sandbox')
#Do not load images
options.add_argument('--blink-settings=imagesEnabled=false')
#Disable notifications
options.add_argument('--disable-desktop-notifications')
#Disable extension
options.add_argument('--disable-extensions')
#Ignore SSL
options.add_argument('--ignore-certificate-errors')
#Disable web security
options.add_argument('--disable-web-security')
driver = webdriver.Chrome(chrome_options=options)
Recommended Posts