截图处理

# 屏幕截图
def save_screen_shot():
    picture_name = DirAndTime.create_picture_path() + '\' + DirAndTime.get_current_time() + '.png'
    try:
        driver.get_screenshot_as_file(picture_name)
        path = '..exceptionpictures\%s'%time.strftime("%Y_%m_%d")
        print("全屏截图成功,图片已保存至:" + path)
    except Exception as e:
        raise e
    else:
        return picture_name
原文地址:https://www.cnblogs.com/xiaochuichui/p/13280927.html