1 window screenshot
2019-06-27 本文已影响0人
初见_0308
'''
get_screenshot_as_file() ://as follow
'''
from selenium import webdriver
from time import sleep
driver= webdriver.Firefox()
driver.get('http://www.baidu.com')
driver.find_element_by_id('kw').send_keys('screenshot')
driver.find_element_by_id('su').click()
# screenshot from current window,and specify save location of the photo
driver.get_screenshot_as_file('D:\\pyse\\baidu_img.jpg')
driver.quit()