使用@DebanjanB 在如何使用 python 在 Selenium 中以编程方式使 firefox 无头中的回复?,我正在尝试使用他的代码并将其更改为使用 --screenshot 参数,但它不起作用。这是我的代码
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument( "--screenshot test.jpg http://google.com/" )
driver = webdriver.Firefox( firefox_options=options )
driver.get('http://google.com/')
print driver.title
driver.quit()
sys.exit()
Run Code Online (Sandbox Code Playgroud)
有人可以让我知道如何在 Python 和 Firefox 中使用 --screenshot 吗?谢谢