当前位置:网站首页>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()边栏推荐
- Disruptor learning notes: basic use, core concepts and principles
- Project summary --01 (addition, deletion, modification and query of interfaces; use of multithreading)
- Simple handwritten ORM framework
- Oauth2.0 - use database to store client information and authorization code
- 多线程与高并发(7)——从ReentrantLock到AQS源码(两万字大章,一篇理解AQS)
- Oracle Database Introduction
- 有意思的鼠標指針交互探究
- Cannot get value with @value, null
- 代码管理工具
- Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
猜你喜欢

. Net program configuration file operation (INI, CFG, config)

ruoyi接口权限校验

Core principles and source code analysis of disruptor

YOLOV1学习笔记

Zhiniu stock -- 03

Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading

Clickhouse learning notes (2): execution plan, table creation optimization, syntax optimization rules, query optimization, data consistency

Tabbar settings

Oauth2.0 - use database to store client information and authorization code

Phpstudy setting items can be accessed by other computers on the LAN
随机推荐
Phpstudy setting items can be accessed by other computers on the LAN
Clickhouse learning notes (2): execution plan, table creation optimization, syntax optimization rules, query optimization, data consistency
PMP笔记记录
In depth learning
MySQL帶二進制的庫錶導出導入
Project summary --04
Common interview questions
Oracle Database Introduction
Fluentd facile à utiliser avec le marché des plug - ins rainbond pour une collecte de journaux plus rapide
JMeter performance automation test
CKA certification notes - CKA certification experience post
Openresty best practices
Luogu problem list: [mathematics 1] basic mathematics problems
Kubernetes notes (IX) kubernetes application encapsulation and expansion
Kubernetes notes (I) kubernetes cluster architecture
Convolution operation in convolution neural network CNN
Kubesphere - build MySQL master-slave replication structure
Support vector machine for machine learning
Simple handwritten ORM framework
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷