一、在python+selenium进行WEB自动化时,常常遇到从计算机本地上传图片的情况,此时,有两种操作方式来解决:
1.使用send_keys(图片地址)直接上传
2.使用AutoIt Windows Info 用于帮助我们识 Windows 控件信息,这样在使用python时间模拟用户操作选择图片;
二、下载AutoIt工具:
链接:https://pan.baidu.com/s/1xvMZ8gMolHKzEM4AB1H2eg
提取码:55rq
或者:https://www.autoitscript.com/site/
三、正常安装(不做说明)
简单说明几个插件的功能:
AutoIt Windows Info 用于帮助我们识 Windows 控件信息。
Compile Script to.exe 用于将 AutoIt 生成 exe 执行文件。
Run Script 用于执行 AutoIt 脚本。
SciTE Script Editor 用于编写 AutoIt 脚本
四、启动AutoIt Windows Info
1.在【开始】--AutoIt Windows Info即可
2.工具主界面:
3.使用方式:使用小风轮拖动至你要抓取的Windows控件
另:关联:pywin32安装:pip install pywin32
AutoItLibrary(使用于fobotframework)
:链接:https://pan.baidu.com/s/1bqBT-AoJJmsHzKqedPhj3A
提取码:638i
安装:将安装包解压至python2的目录下,管理员权限cmd,切换至 AutoItLibrary 解压目录;然后:
python setup.py install