截取一张照片: driver.save_screenshot(“具体路径//error.png”) 截取多张照片,并保存: current_time = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time())) //获取系统当前时间,作为图片的命名格式 pic_path = ‘路径’ + current_time + ‘.png’ driver.save_screenshot(pic_path)