exclude switches in firefox webdriver options

前端 未结 2 1493
有刺的猬
有刺的猬 2021-02-01 09:18

Using Selenium and python, I can do this with Chrome webdriver:

options.add_experimental_option(\"excludeSwitches\", [\"enable-automation\"])
driver = webdriver.         


        
2条回答
  •  天涯浪人
    2021-02-01 09:52

    you may try:

    from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
    from selenium.webdriver import DesiredCapabilities
    from selenium.webdriver import Firefox
    
    
    profile = FirefoxProfile()
    profile.set_preference('devtools.jsonview.enabled', False)
    profile.update_preferences()
    desired = DesiredCapabilities.FIREFOX
    
    driver = Firefox(firefox_profile=profile, desired_capabilities=desired)
    

提交回复
热议问题