- Python 3.11
- ChromeDriver 107.0.5304.62
- Chrome 107.0.5304.107
- Selenium 4.6.0
Chromedriver console always shows when I try to build exe with pyinstaller.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from subprocess import CREATE_NO_WINDOW
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = r'D:\Test\bin\chrome.exe'
chrome_service = ChromeService(r'D:\Test\bin\chromedriver.exe')
chrome_service.creationflags = CREATE_NO_WINDOW
driver = webdriver.Chrome(service=chrome_service, options=chrome_options)
driver.get('http://google.com')
I have tried to build exe with pyinstaller in different ways:
pyinstaller Test.py
pyinstaller Test.pyw
pyinstaller Test.py --windowed or --noconsole
pyinstaller Test.pyw --windowed or --noconsole
I also tried to change in venv\Lib\site-packages\selenium\webdriver\common\service.py at line 67
self.creation_flags = 0
to
self.creation_flags = 1
I also tried different chrome/chromedriver combinations