Last active
January 1, 2024 15:52
-
-
Save Apocryphon-X/3949acbb89478c97aeb9ac3025e0d8f7 to your computer and use it in GitHub Desktop.
Create an instance of Google Chrome (using a Chromedriver) with no infobars and no webdriver console. Works with Python 3 and Selenium == 4.0.0b3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import CREATE_NO_WINDOW | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.chrome.service import Service | |
service = Service("chromedriver.exe") | |
service.creationflags = CREATE_NO_WINDOW | |
chrome_options = webdriver.ChromeOptions() | |
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"]) | |
driver = webdriver.Chrome(options=chrome_options, service=service) | |
driver.get("https://google.com/") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment