Skip to content

Instantly share code, notes, and snippets.

@Bruno-Messias
Created April 7, 2025 12:48
Show Gist options
  • Save Bruno-Messias/65e1062bb682d385b6a8e5803a0aab23 to your computer and use it in GitHub Desktop.
Save Bruno-Messias/65e1062bb682d385b6a8e5803a0aab23 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
chromedriver_path = "path/to/chromedriver"
options = webdriver.ChromeOptions()
options.add_experimental_option("prefs", {
"profile.default_content_settings.popups": 0,
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"safebrowsing.enabled": True,
"profile.default_content_setting_values.automatic_downloads": 1,
})
options.add_argument("--lang=pt-BR")
options.add_argument("--headless=new")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
driver = webdriver.Chrome(service=Service(chromedriver_path), options=options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment