How to make Firefox headless programmatically in Selenium with Python?

后端 未结 6 972
面向向阳花
面向向阳花 2020-11-22 11:37

I am running this code with python, selenium, and firefox but still get \'head\' version of firefox:

binary = FirefoxBinary(\'C:\\\\Program Files (x86)\\\\Mo         


        
6条回答
  •  孤独总比滥情好
    2020-11-22 11:43

    My answer:

    set_headless(headless=True) is deprecated. 
    

    https://seleniumhq.github.io/selenium/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.options.html

    options.headless = True
    

    works for me

提交回复
热议问题