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 = "e:\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")