python3、selenium、autoit3,通过flash控件上传文件

时间:2014-05-15 21:21:46   收藏:0   阅读:510

autoit.au3

bubuko.com,布布扣
#include <Constants.au3>

WinWait("打开","",20);     //暂停执行脚本,直到上传对话框出现
WinActive("打开")
WinWaitActive("打开","",5);    //激活上传窗口
ControlFocus("打开", "", "[CLASS:Edit; INSTANCE:1]")
ControlSetText("打开", "", "[CLASS:Edit; INSTANCE:1]", "C:\DATA\Get It Started.mp4"); //输入路径

Send("!o"); //键盘快捷键Alt+O
bubuko.com,布布扣

将autoit.au3文件通过Compile Script to .exe编译成.exe文件

python

bubuko.com,布布扣
import os  #引入os库
……
……

self.driver.find_element_by_id(“XXX”).click() #点击上传按钮,显示出文件选择框
os.system("C:\\autoit3.exe")  #调用文件

……
……其他过程省略
bubuko.com,布布扣

 

python3、selenium、autoit3,通过flash控件上传文件,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!