(Feb-11-2019, 09:21 PM)metulburr Wrote: i dont get that window....but im in linux. Im sure there is a flag somewhere to stop it.
https://stackoverflow.com/questions/2587...ole-window
Quote:It shouldnt matter. driver.get() will open the site. If you are on your current tab, it will change it, if you switch to a new tab, it will open it in that tab, and so on and so on. You are opening each and every tab, so you would know how many you open and if you need more.
I am successful to hide the Console of ChromeDriver
Kindly modify the source code at
..\Python37\Lib\site-packages\selenium\webdriver\common\service.py
And allocate the code below and begin modify
def start(self): """ Starts the Service. :Exceptions: - WebDriverException : Raised either when it can't start the service or when it can't connect to the service """ try: cmd = [self.path] cmd.extend(self.command_line_args()) self.process = subprocess.Popen(cmd, env=self.env, close_fds=platform.system() != 'Windows', stdout=self.log_file, stderr=self.log_file, creationflags=0x08000000, ## To hide Console Window stdin=PIPE)Yeah. Because I am using several files to design the automate script, and using 3rd time software to design the application GUI.
Therefore, the GUI have several fancy buttons, each buttons will trigger different .exe file (Currently stuck on covert .py to .exe)
For example, btnGoogle will trigger googleAutomate.exe, btnYahoo will trigger yahooAutomate.exe, and so on.
So my concern is how to check if chrome running/exist? If so then how to launch new tab?
For example Code:
## This is googleAutomate.exe ## CODE TO CHECK IF CHROME RUNNING/EXIST ## IF EXIST THEN DON'T NEED LAUNCH CHROME DRIVER AGAIN ## BUT TO ASSIGN THE CHROME TO driver driver = webdriver.Chrome(executable_path=r'chromedriver.exe') driver.get("https://www.google.com")
## This is yahooAutomate.exe ## CODE TO CHECK IF CHROME RUNNING/EXIST ## IF EXIST THEN DON'T NEED LAUNCH CHROME DRIVER AGAIN ## BUT TO ASSIGN THE CHROME TO driver driver = webdriver.Chrome(executable_path=r'chromedriver.exe') driver.get("https://malaysia.yahoo.com/?p=us")