# -*- coding:utf-8 -*-
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('selenium')
driver.find_element_by_id('su').click()
sleep(3)
driver.get_screenshot_as_file('c:/users/os/Desktop/baidu.jpg')
driver.quit()
selenium截取当前窗口,并保存为图片
最新推荐文章于 2024-06-18 15:23:28 发布