So, after fixing my code:
options = webdriver.ChromeOptions() options.add_experimental_option("excludeSwitches",["ignore-certificate-errors"]) options.add_argument('--disable-gpu') options.add_argument('--headless') chrome_driver_path = "C:\Python27\Scripts\chromedriver.exe"
The .exe file still appeared when the script started. Although it got rid of some additional output, telling me: "The GPU process failed to start."
As a result, I was running my Python script using a .bat file
So basically
- Save python script if folder
Open a text editor and upload the following code (of course, edit the script)
c: \ python27 \ python.exe c: \ SampleFolder \ ThisIsMyScript.py% *
Save the .txt file and change the extension to .bat
- Double-click this to run the file.
So, this just opened the script on the command line, and ChromeDriver seems to be working in this window without jumping to the forefront of my screen and thereby solving the problem.
source share