Python

Selenium Chrome Option

Kyle79 2022. 12. 11. 14:19
options = webdriver.ChromeOptions()
options.add_argument('--kiosk')
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--hide-scrollbars')
# options.add_argument('--single-process')
options.add_argument('--ignore-certificate-errors')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--auto-open-devtools-for-tabs')
options.add_argument('--disable-setuid-sandbox')
options.add_argument('--dns-prefetch-disable')
options.add_argument("enable-automation")
options.add_argument("--disable-browser-side-navigation")
options.add_argument('--ignore-certificate-errors-spki-list')
options.add_argument('--ignore-ssl-errors')
options.add_argument("--ignore_ssl")

options.add_argument("--disable-application-cache")
options.add_argument("--disable-crash-reporter")
options.add_argument("--disable-in-process-stack-traces")
options.add_argument("--output=/dev/null")
options.add_argument('--disable-features=IsolateOrigins,site-per-process')

options.add_argument("--lang=en_US.UTF-8")
options.add_argument("--language=en_US:en")
options.add_argument("--lc_all=en_US.UTF-8")

options.add_argument("--homedir=/tmp")
options.add_argument("--disk-cache-dir=/tmp/cache-dir")
options.add_argument("--data-path=/tmp/data-path")
options.add_argument("--user-data-dir=/tmp/user-data")
options.add_argument("--disable-software-rasterizer")
options.add_argument('--disable-logging')
options.add_argument('--log-level=3')
options.add_argument('--v=99')

options.add_argument('--no-zygote')
options.add_argument('--no-startup-window')
options.add_argument("--disable-session-crashed-bubble")
options.add_argument("--disable-ipv6")
options.add_argument("--allow-http-screen-capture")
options.add_argument('--vmodule')
# options.add_argument('--remote-debugging-port=9222')
options.add_argument("--disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_argument("--incognito")
options.add_argument("--disable-popup-blocking")
options.add_argument("--excludeSwitches")
options.add_argument("--disable-default-app")
# options.add_argument("--disable-web-security")
options.add_argument("--disable-site-isolation-trials")
options.add_argument("--allow-cross-origin-auth-prompt")
options.add_argument("--allow-running-insecure-content")
options.add_argument('--allow-insecure-localhost')

options.add_argument("--allow-file-access")
options.add_argument("--allow-file-access-from-files")

options.add_argument('--load-images=false')
options.add_argument('--proxy-type=http')
options.add_argument('--ssl-protocol=any')

options.add_argument("start-fullscreen")
options.add_argument("start-maximized")

prefs = {
"intl.accept_languages": "en,en_US",
"profile.managed_default_content_settings.images":2,
"profile.default_content_setting_values.notifications":2,
"profile.managed_default_content_settings.stylesheets":2,
"profile.managed_default_content_settings.cookies":2,
"profile.managed_default_content_settings.javascript":1,
"profile.managed_default_content_settings.plugins":1,
"profile.managed_default_content_settings.popups":2,
"profile.managed_default_content_settings.geolocation":2,
"profile.managed_default_content_settings.media_stream":2,
"credentials_enable_service": False,
"profile.password_manager_enabled": False,
}
options.add_experimental_option("prefs", prefs)
options.add_experimental_option("detach", True)
options.add_experimental_option('excludeSwitches', ['enable-automation'])

'Python' 카테고리의 다른 글

User-agent generator  (0) 2022.12.11
Selenium Wire Option  (2) 2022.12.11
ChromeDriver & Selenium Wire setting  (0) 2022.12.11
pip 설치시, SSL 오류  (0) 2022.04.02
PynamoDB  (0) 2021.11.10