WebDriver screenshot of the window --- (Mushishi "selenium3 automated testing combat - based on the Python language note 27")

Providing webdriver theme function: save_screenshot (), used to intercept the current window

from the Selenium Import webdriver 

Driver = webdriver.Chrome () 
driver.get ( " http://www.baidu.com " ) 

# interception of the current window, specify the location to save the screenshot picture 
driver.save_screenshot ( " ./baidu_img.png " )

 

Guess you like

Origin www.cnblogs.com/kite123/p/11532772.html