Python+selenium
tb_bt
跳跃在指尖的命令行
展开
-
Python + selenium命名截图并保存到指定文件夹
1.0 需要导入pathlib的Path类: from pathlib import Path 2.0 截图函数: 可以使用以下两种 driver.save_screenshot() driver.get_screenshot_as_file() 3.0 实现: i=1 scrpath='D:\\Ex3' #指定的保存目录 capturename = '\\'+str(i...原创 2018-03-07 13:13:23 · 8660 阅读 · 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 · 7048 阅读 · 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 · 7065 阅读 · 1 评论