当前位置:网站首页>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()边栏推荐
- Fluentd facile à utiliser avec le marché des plug - ins rainbond pour une collecte de journaux plus rapide
- Some thoughts on machine learning
- 从小数据量 MySQL 迁移数据到 TiDB
- About the difference between count (1), count (*), and count (column name)
- Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
- [set theory] equivalence relation (concept of equivalence relation | examples of equivalence relation | equivalence relation and closure)
- arcgis创建postgre企业级数据库
- JMeter performance automation test
- CKA certification notes - CKA certification experience post
- Kubernetes cluster environment construction & Deployment dashboard
猜你喜欢

Kubernetes notes (10) kubernetes Monitoring & debugging

After the Chrome browser is updated, lodop printing cannot be called

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

智牛股--03

Creating postgre enterprise database by ArcGIS

Pytorch builds the simplest version of neural network

Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation

YOLOV1学习笔记

Kubernetes notes (IX) kubernetes application encapsulation and expansion

Alibaba cloud OOS file upload
随机推荐
The most responsible command line beautification tutorial
Core principles and source code analysis of disruptor
conda和pip的区别
Tabbar settings
Zhiniu stock project -- 05
PHP用ENV获取文件参数的时候拿到的是字符串
技术管理进阶——你了解成长的全貌吗?
Kubernetes cluster environment construction & Deployment dashboard
Mysql database binlog log enable record
智牛股--03
.NET程序配置文件操作(ini,cfg,config)
Use abp Zero builds a third-party login module (I): Principles
Mysql
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
Kubernetes notes (IV) kubernetes network
Migrate data from Amazon aurora to tidb
The programmer shell with a monthly salary of more than 10000 becomes a grammar skill for secondary school. Do you often use it!!!
Kubernetes notes (II) pod usage notes
Exportation et importation de tables de bibliothèque avec binaires MySQL
Oauth2.0 - use database to store client information and authorization code