- 博客(8)
- 收藏
- 关注
原创 python3+selenium:截图并保存到指定文件夹
一、截图方法1.get_screenshot_as_file(self, filename)--这个方法是获取当前window的截图,出现IOError时候返回False,截图成功返回True。filename参数是保存文件的路径。driver.get_screenshot_as_file('/Screenshots/foo.png')2.get_screenshot_as...
2020-01-12 17:33:00 5124 2
原创 python3:日志模块封装
#!/usr/bin/env python# coding: utf-8import loggingimport timeimport osdef get_log(log_model_name, style='console'): """ :param log_model_name: 要打印日志的模块名 :param style: 日志打印方式,conso...
2020-01-12 16:04:51 1128
原创 selenium.common.exceptions.InvalidElementStateException
selenium.common.exceptions.InvalidElementStateException: Message: invalid element state元素状态无效:原因1:元素未加载出来,添加等待原因2:元素定位不准确,定位的不可点击;应定位要可点击的那一层标签...
2020-01-12 14:11:38 7899 3
原创 python+selenium:数据参数化(从文件读取数据)
#!/usr/bin/env python# -*- coding=utf-8 -*-# coding: utf-8from selenium import webdriverfrom selenium.webdriver.support.ui import WebDriverWaitfrom common.read_txt import read_txt# from co...
2020-01-12 10:59:02 1438
原创 python3:从excel中读取数据,并以字典组成的列表返回
#!/usr/bin/env python# coding: utf-8import xlrddef read_xlsx(path, sheet): # book = xlrd.open_workbook(path) # 打开excel表 with xlrd.open_workbook(path, 'rb') as book: table =...
2020-01-12 10:45:48 1875
转载 ChromeDriver与Chrome版本对应参照表及ChromeDriver下载链接
ChromeDriver与Chrome版本对应参照表:https://blog.csdn.net/BinGISer/article/details/88559532ChromeDriver下载链接:http://chromedriver.storage.googleapis.com/index.html
2020-01-11 18:00:22 796
原创 Python3:遍历文件夹中文件并修改后缀名
公司对安全要求很高,不允许邮件发送代码后缀文件,但是需要用到一些python库,而PC又无法访问外网,不能先把python库文件转换为“.txt”格式的发送了,才有了下面的轮子:#!/usr/bin/env python# -*- coding=utf-8 -*-# coding: utf-8import osimport shutildef show_files(path...
2020-01-09 20:57:21 1281
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人