Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chromedriver launch new tab
#6
(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")
Reply


Messages In This Thread
Chromedriver launch new tab - by gahhon - Feb-10-2019, 03:57 PM
RE: Chromedriver launch new tab - by Larz60+ - Feb-10-2019, 06:31 PM
RE: Chromedriver launch new tab - by metulburr - Feb-10-2019, 06:39 PM
RE: Chromedriver launch new tab - by gahhon - Feb-11-2019, 02:55 PM
RE: Chromedriver launch new tab - by metulburr - Feb-11-2019, 09:21 PM
RE: Chromedriver launch new tab - by gahhon - Feb-13-2019, 02:08 PM
RE: Chromedriver launch new tab - by metulburr - Feb-13-2019, 10:35 PM
RE: Chromedriver launch new tab - by gahhon - Feb-14-2019, 04:09 PM
RE: Chromedriver launch new tab - by metulburr - Feb-15-2019, 04:56 PM
RE: Chromedriver launch new tab - by gahhon - Feb-16-2019, 07:39 AM
RE: Chromedriver launch new tab - by metulburr - Feb-16-2019, 01:39 PM
RE: Chromedriver launch new tab - by gahhon - Feb-16-2019, 07:00 PM
RE: Chromedriver launch new tab - by gahhon - Feb-16-2019, 10:04 PM
RE: Chromedriver launch new tab - by metulburr - Feb-17-2019, 12:04 AM
RE: Chromedriver launch new tab - by gahhon - Feb-17-2019, 04:13 PM
RE: Chromedriver launch new tab - by metulburr - Feb-17-2019, 06:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium undetected Chromedriver Bot Laurin0000 1 4,068 Apr-13-2023, 09:20 PM
Last Post: Clixmaster
  enable flash using selenium chromedriver Fre3k 1 4,284 Nov-27-2020, 12:15 PM
Last Post: JellyCreeper6
  WebDriverException: 'chromedriver' executable needs to be in PATH pyzyx3qwerty 9 12,742 Jun-09-2020, 05:43 PM
Last Post: Yoriz
  Selenium Chromedriver Automation Help lessthanthree 1 2,152 May-05-2020, 11:03 PM
Last Post: Larz60+
  How to identify chromedriver version? metulburr 2 7,612 Jun-13-2019, 11:37 PM
Last Post: metulburr
  chromedriver.exe issue gahhon 2 2,814 Feb-12-2019, 12:09 PM
Last Post: metulburr
  Selenium chromedriver and click action Gilles95 4 13,278 Feb-07-2018, 07:28 PM
Last Post: Gilles95

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020