#以时间年月日创建文件夹,并以时分秒保存截图图片
import os
import os.path
import time
from selenium import webdriver
urls=["http://www.baidu.com","http://www.sogou.com","http://cn.bing.com"]
dir_name=time.strftime("%Y-%m-%d",time.localtime())
if not os.path.exists("e:\\"+dir_name):
os.mkdir("e:\\"+dir_name)
driver = webdriver.Ie(executable_path = "g:\\IEDriverServer")
os.chdir("e:\\"+dir_name)
for url in urls:
driver.get(url)
driver.get_screenshot_as_file(time.strftime("%H-%M-%S",time.localtime())+".png")