selenium2 怎样给当前窗口截图?
使用webdriver
提供的save_screenshot
方法:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('http://www.python.org/')
driver.save_screenshot('screenshot.png')
driver.quit()
使用webdriver
提供的save_screenshot
方法:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('http://www.python.org/')
driver.save_screenshot('screenshot.png')
driver.quit()