
Python+selenium
tb_bt
跳跃在指尖的命令行
展开
-
Python + selenium命名截图并保存到指定文件夹
1.0 需要导入pathlib的Path类:from pathlib import Path2.0 截图函数: 可以使用以下两种driver.save_screenshot()driver.get_screenshot_as_file()3.0 实现:i=1scrpath='D:\\Ex3' #指定的保存目录capturename = '\\'+str(i...原创 2018-03-07 13:13:23 · 8772 阅读 · 0 评论 -
Python+selenium 获取浏览器窗口坐标、句柄
1.0 获取浏览器窗口坐标 python目录可找到Webdriver.py 文件定义了get_window_rect()函数,可获取窗口的坐标和大小(长宽),但出现”Command not found”的情况。set_window_rect()函数也一样。def get_window_rect(self): """ Gets the x, y coordinates of...原创 2018-03-08 22:42:45 · 7129 阅读 · 0 评论 -
Pip安装pyinstaller出现utf-8解码错误
安装pyinstaller a. python未设置环境变量: cmd转到python的script目录,输入命令pip install pyinstaller b. python已设置环境变量 cmd直接输入命令pip install pyinstaller在安装过程中出现了解码错误: “UnicodeDecodeError: ‘utf-8’ codec can...原创 2018-03-05 12:29:14 · 7159 阅读 · 1 评论