当前位置:网站首页>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()边栏推荐
- 1. 兩數之和
- Advanced technology management - do you know the whole picture of growth?
- Migrate data from Amazon aurora to tidb
- Mysql database
- 有意思的鼠標指針交互探究
- Oauth2.0 - use database to store client information and authorization code
- MySQL带二进制的库表导出导入
- Printer related problem record
- JMeter performance automation test
- Apple submitted the new MAC model to the regulatory database before the spring conference
猜你喜欢

Support vector machine for machine learning

Kubernetes notes (10) kubernetes Monitoring & debugging

Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster

Convolution operation in convolution neural network CNN
![[set theory] relational closure (relational closure solution | relational graph closure | relational matrix closure | closure operation and relational properties | closure compound operation)](/img/a4/00aca72b268f77fe4fb24ac06289f5.jpg)
[set theory] relational closure (relational closure solution | relational graph closure | relational matrix closure | closure operation and relational properties | closure compound operation)

【系统设计】邻近服务

Simple solution of small up main lottery in station B

IE browser flash back, automatically open edge browser

Kubernetes cluster environment construction & Deployment dashboard

智牛股--03
随机推荐
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
Decision tree of machine learning
In depth analysis of kubernetes controller runtime
88. 合并两个有序数组
Understand expectations (mean / estimate) and variances
Oauth2.0 - Introduction and use and explanation of authorization code mode
冒泡排序的简单理解
Alibaba cloud OOS file upload
What's the difference between using the Service Worker Cache API and regular browser cache?
Analysis of Clickhouse mergetree principle
表达式的动态解析和计算,Flee用起来真香
Jedis source code analysis (II): jediscluster module source code analysis
BeanDefinitionRegistryPostProcessor
About the difference between count (1), count (*), and count (column name)
Simple understanding of ThreadLocal
致即将毕业大学生的一封信
Maximum likelihood estimation, divergence, cross entropy
Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading
PMP笔记记录
Apple submitted the new MAC model to the regulatory database before the spring conference