当前位置:网站首页>Time format record
Time format record
2022-07-03 06:15:00 【Bobo AI leaves work】
import time
time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time()))
picture_time = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time()))
driver.get_screenshot_as_file('D:\\pycharm\\PyCharm Community Edition 2021.1.3\\jbr\\bin\\pythonProject\\pythonProject23\\images\\'+picture_time+'.png')picture_time = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time()))
driver.get_screenshot_as_file('D:\\pycharm\\PyCharm Community Edition 2021.1.3\\jbr\\bin\\pythonProject\\pythonProject23\\images\\'+picture_time+'.png')ima_time = str(time.time()).replace(".", "_")driver.save_screenshot('.\\baidu4.png')# Screenshot mode 2
# coding=utf-8
from selenium import webdriver
import os
import time
# Generate year month day hour minute second time
picture_time = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time()))
directory_time = time.strftime("%Y-%m-%d", time.localtime(time.time()))
print(picture_time)
print(directory_time)
# Print file directory
print(os.getcwd())
# Gets the directory of the current file , And check if there is directory_time Folder , If it does not exist, it will be automatically created directory_time file
try:
File_Path = os.getcwd() + '\\' + directory_time + '\\'
if not os.path.exists(File_Path):
os.makedirs(File_Path)
print(" Directory creation succeeded :%s" % File_Path)
else:
print(" directory already exists !!!")
except BaseException as msg:
print(" Failed to create new directory :%s" % msg)
driver = webdriver.Chrome()
driver.get("https://baidu.com/")
try:
url=driver.save_screenshot('.\\' + directory_time + '\\' + picture_time + '.png')
print("%s : Screenshot successful !!!" % url)
except BaseException as pic_msg:
print(" Screenshot failed :%s" % pic_msg)
time.sleep(2)
driver.quit()边栏推荐
猜你喜欢

表达式的动态解析和计算,Flee用起来真香

有意思的鼠標指針交互探究

Click cesium to obtain three-dimensional coordinates (longitude, latitude and elevation)

Simple solution of small up main lottery in station B

Kubesphere - Multi tenant management

Kubernetes notes (IV) kubernetes network

使用 Abp.Zero 搭建第三方登录模块(一):原理篇

Pytorch dataloader implements minibatch (incomplete)

Simple handwritten ORM framework

Project summary --2 (basic use of jsup)
随机推荐
SVN分支管理
表达式的动态解析和计算,Flee用起来真香
剖析虚幻渲染体系(16)- 图形驱动的秘密
Selenium ide installation recording and local project maintenance
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
conda和pip的区别
Oauth2.0 - explanation of simplified mode, password mode and client mode
Kubernetes notes (V) configuration management
arcgis创建postgre企业级数据库
Luogu problem list: [mathematics 1] basic mathematics problems
Mysql database table export and import with binary
Intel's new GPU patent shows that its graphics card products will use MCM Packaging Technology
phpstudy设置项目可以由局域网的其他电脑可以访问
使用conda创建自己的深度学习环境
CKA certification notes - CKA certification experience post
Difference between shortest path and minimum spanning tree
Maximum likelihood estimation, divergence, cross entropy
Pytorch builds the simplest version of neural network
Creating postgre enterprise database by ArcGIS
Oauth2.0 - use database to store client information and authorization code