Город МОСКОВСКИЙ
00:00:58

How to hide Chromedriver console window when running exe or GUI in Python selenium

Аватар
PHP Сниппеты
Просмотры:
25
Дата загрузки:
01.12.2023 16:24
Длительность:
00:00:58
Категория:
Лайфстайл

Описание

How to hide Chromedriver console window when running .exe or in GUI in Python selenium. If you are running headless mode replace your driver with these lines of code
op = webdriver.ChromeOptions()
op.add_argument("--window-size=1920,1080")
op.add_argument("--start-maximized")
op.headless = True
serv = ChromeService(ChromeDriverManager().install())
serv.creationflags = CREATE_NO_WINDOW
driver = webdriver.Chrome(service=serv, options=op)
If not in headless mode, replace your driver with these lines of code
chrome_service = ChromeService(ChromeDriverManager().install())
chrome_service.creationflags = CREATE_NO_WINDOW
driver = webdriver.Chrome(service=chrome_service)

Рекомендуемые видео