hide chromeDriver console in python

后端 未结 3 1581
庸人自扰
庸人自扰 2020-12-01 07:25

I\'m using chrome driver in Selenium to open chrome , log into a router, press some buttons ,upload configuration etc. all code is written in Python.

here is the par

3条回答
  •  醉话见心
    2020-12-01 07:43

    While launching chrome browser not seeing chromedriver console with the given sample code.

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options 
    from time import sleep
    options = webdriver.ChromeOptions()
    prefs = {"download.default_directory":  r"C:\New_Download"}
    options.add_experimental_option("prefs", prefs)
    print(options.experimental_options)
    
    chromeDriverPath = r'C:\drivers\chromedriver.exe'
    driver = webdriver.Chrome(chromeDriverPath,chrome_options=options)
    driver.get("http://google.com")
    driver.set_window_position(0, 0)
    driver.set_window_size(0, 0)
    

提交回复
热议问题