I have a simple Python script which uses selenium and webdriver to open up Facebook in a Chrome window and log in automatically. When I run it, the Chromedriver console window opens up and stays open even after the entire program has finished execution, until I close it myself.
Is there a way to hide this console window? I have tried keeping a ".pyw" extension for my script, but that doesn't help since it's not the script's console window but the Chromedriver subprocess' console window that I wish to hide.
I couldn't find any resources on this. I think I might need to modify the chrome webdriver source code, but I don't know how. This is my code:
from selenium import webdriver
import sys
driver = webdriver.Chrome("C:\Python27\Scripts\chromedriver.exe")
driver.get("https://www.facebook.com")
email = driver.find_element_by_id("email")
passwd = driver.find_element_by_id("pass")
email.clear()
passwd.clear()
email.send_keys("example@example.com")
passwd.send_keys("examplepassword")
passwd.submit()