当前位置:网站首页>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()边栏推荐
- Nacos service installation
- Kubernetes notes (IX) kubernetes application encapsulation and expansion
- When PHP uses env to obtain file parameters, it gets strings
- 88. Merge two ordered arrays
- [system design] proximity service
- 輕松上手Fluentd,結合 Rainbond 插件市場,日志收集更快捷
- BeanDefinitionRegistryPostProcessor
- Pdf files can only print out the first page
- Kubernetes notes (I) kubernetes cluster architecture
- Mysql5.7 group by error
猜你喜欢

In depth analysis of kubernetes controller runtime

Support vector machine for machine learning

輕松上手Fluentd,結合 Rainbond 插件市場,日志收集更快捷

Es remote cluster configuration and cross cluster search

ThreadLocal的简单理解

Mysql

Cesium 点击获取模型表面经纬度高程坐标(三维坐标)

Maximum likelihood estimation, divergence, cross entropy

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

Kubernetes notes (I) kubernetes cluster architecture
随机推荐
[system design] proximity service
Oauth2.0 - using JWT to replace token and JWT content enhancement
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
Oauth2.0 - use database to store client information and authorization code
冒泡排序的简单理解
Kubernetes notes (III) controller
Selenium ide installation recording and local project maintenance
There is no one of the necessary magic skills PXE for old drivers to install!!!
Advanced technology management - do you know the whole picture of growth?
Printer related problem record
phpstudy设置项目可以由局域网的其他电脑可以访问
Method of converting GPS coordinates to Baidu map coordinates
輕松上手Fluentd,結合 Rainbond 插件市場,日志收集更快捷
SVN分支管理
Simple handwritten ORM framework
Get a screenshot of a uiscrollview, including off screen parts
arcgis创建postgre企业级数据库
Oauth2.0 - explanation of simplified mode, password mode and client mode
Detailed explanation of contextclassloader
Migrate data from Amazon aurora to tidb