- 按键认证大神
- 2699998
- 3431
- 11
- 2170 朵
- 7212 个
- 857 个
- 91120
- 2014-08-23
|
1#
t
t
发表于 2018-02-07 17:47
|
|
神梦填表插件com版出来了!
支持 ie、谷歌浏览器
支持跨域夸框架穿透填表
【元素智能定位】
【上传文件】
【处理弹窗】
【滑动验证码】
【执行js】
| 插件预览演示例子插件例子- '【神梦填表插件 smweb.dll 演示按键例子】
- '作者:神梦无痕
- 'qq:1042207232
- 'q群:624655641
- '插件版本号
- traceprint "插件版本号:" & plugin.smweb.ver()
- traceprint("**********************【神梦填表插件 smweb.dll 演示按键例子】**********************")
- //生成插件帮助文档
- traceprint(plugin.smweb.about())
- //初始化插件
- call plugin.smweb.init()
- 绑定句柄数组 = array("ie.exe", "chrome.exe")
- for iw = 0 to ubound(绑定句柄数组)
- //绑定浏览器
- tips("正在绑定浏览器:" & 绑定句柄数组(iw)) : traceprint(运行状态)
- if plugin.smweb.bind(绑定句柄数组(iw)) = false then
- msgbox "出错,绑定浏览器失败!"
- exitscript
- end if
-
-
- tips("打开 smweb 测试页面") : traceprint(运行状态)
- call plugin.smweb.tabgo("http://127.0.0.1:8008/smweb.html")
- call plugin.smweb.tabisready(30) '判断网页是否加载完毕
- delay(2000)
-
-
- '网页截图
- tips("【网页截图】:截取区域 0, 0, 400, 200 范围图像保存到文件 c:\1.png") : traceprint(运行状态)
- call plugin.smweb.tabsnapshot(0, 0, 400, 200, "c:\1.png")
- delay(2000)
-
-
- '【预处理弹窗】:提前为弹出窗口做准备(点击确定按钮)
- call plugin.smweb.tabgo("#tabpredialog"):delay(1000)
- tips("【预处理弹窗】:提前为弹出窗口做准备(三个连续弹窗,需要点击三个按钮:true=确定;false=取消)") : traceprint(运行状态)
- call plugin.smweb.tabpredialog("神梦无痕", "true|false|true")
- '点击按钮,弹出窗口
- tips("点击【无返回弹窗】") : traceprint(运行状态)
- call plugin.smweb.htmlclick("#mypredialog_alert")
- tips("点击【有返回值弹窗】") : traceprint(运行状态)
- call plugin.smweb.htmlclick("//*[@id='mypredialog_confirm']")
- tips("点击【可输入内容弹窗】") : traceprint(运行状态)
- call plugin.smweb.htmlclick("id:mypredialog_prompt")
- '获取弹窗内容
- tips("【获取弹窗内容】:" & plugin.smweb.tabgetdialog()) : traceprint(运行状态)
- delay (2000)
-
-
- '元素点击
- call plugin.smweb.tabgo("#htmlclick"):delay(1000)
- tips("【点击元素】:" & plugin.smweb.htmlclick("id:myclick")) : traceprint(运行状态)
- delay(1000)
-
-
- '输入文本内容
- call plugin.smweb.tabgo("#htmlinput"):delay(1000)
- tips("【输入框】:神梦无痕") : traceprint(运行状态)
- call plugin.smweb.htmlinput("神梦无痕", "#myinput")
- delay(1000)
-
-
- '勾选单/复选框
- call plugin.smweb.tabgo("#htmlcheck"):delay(1000)
- tips("【单选框】:勾选") : traceprint(运行状态)
- call plugin.smweb.htmlcheck(true, "[id='myradio']")
- tips("【复选框】:勾选") : traceprint(运行状态)
- call plugin.smweb.htmlcheck(true, "//*[@id='mycheck']")
- delay(1000)
-
-
- '设置下拉框
- call plugin.smweb.tabgo("#htmlselect"):delay(1000)
- tips("【下拉框】:香蕉") : traceprint(运行状态)
- call plugin.smweb.htmlselect("香蕉", "id:myselect")
- delay(1000)
-
-
- '设置元素信息
- call plugin.smweb.tabgo("#htmlset"):delay(1000)
- tips("【设置信息】:value") : traceprint(运行状态)
- call plugin.smweb.htmlset("value", "【作者】:神梦无痕", "id:myset")
- delay(1000)
- tips("【设置信息】:name") : traceprint(运行状态)
- call plugin.smweb.htmlset("name", "qq_1042207232", "id:myset")
- delay(1000)
-
-
- '获取元素信息
- tips("【获取信息】:value") : traceprint(运行状态)
- tips (" :" & plugin.smweb.htmlget("value", "id:myset")) : traceprint (运行状态)
- delay(1000)
- tips("【获取信息】:outerhtml") : traceprint(运行状态)
- tips(" :" & plugin.smweb.htmlget("outerhtml", "id:myset")) : traceprint(运行状态)
- delay(1000)
-
-
- '滚动到指定元素
- call plugin.smweb.tabgo("#htmlscroll"):delay(2000)
- tips("【滚动定位】:" & plugin.smweb.htmlscroll("name:htmlhover")) : traceprint(运行状态)
- delay(2000)
-
-
- '鼠标在元素上悬停
- tips("【元素悬停】:" & plugin.smweb.htmlhover("#myhover")) : traceprint(运行状态)
- delay(1000)
-
-
- '滑动验证码
- call plugin.smweb.tabgo("#htmlswipe"):delay(1000)
- tips("【滑动验证】:" & plugin.smweb.htmlswipe(128, 420, 400, 420, "#swipe_btn")) : traceprint(运行状态)
- delay(1000)
-
-
-
- '执行元素事件
- call plugin.smweb.tabgo("#htmlevent"):delay(1000)
- tips("【执行事件】:鼠标左键按下") : traceprint(运行状态)
- call plugin.smweb.htmlevent("mousedown", "#myevent")
- tips("【执行事件】:输入框改变") : traceprint(运行状态)
- call plugin.smweb.htmlevent("change", "#myevent")
- delay(1000)
-
-
- '上传图片文件
- call plugin.smweb.tabgo("#htmlinputfile") : delay(1000)
- tips("【图片路径】:c:\1.png") : traceprint(运行状态)
- call plugin.smweb.htmlinputfile("c:\1.png", "id:myinputfile")
- delay(1000)
-
-
- '添加/还原元素边框
- call plugin.smweb.tabgo("#htmlborder") : delay(1000)
- tips("【添加边框】:" & plugin.smweb.htmlborder(true, "//*[@id='myborder']")) : traceprint(运行状态)
- delay(1000)
- tips("【还原边框】:" & plugin.smweb.htmlborder(false, "//*[@id='myborder']")) : traceprint(运行状态)
- delay(1000)
-
-
- '启用/禁用元素
- call plugin.smweb.tabgo("#htmlenabled") : delay(1000)
- tips("【禁用元素】:" & plugin.smweb.htmlenabled(false, "#myenabled")) : traceprint(运行状态)
- delay(1000)
- tips("【启用元素】:" & plugin.smweb.htmlenabled(true, "#myenabled")) : traceprint(运行状态)
- delay(1000)
-
-
- '显示/隐藏元素
- call plugin.smweb.tabgo("#htmlvisible") : delay(1000)
- tips("【隐藏元素】:" & plugin.smweb.htmlvisible(false, "id:myvisible")) : traceprint(运行状态)
- delay(1000)
- tips("【显示元素】:" & plugin.smweb.htmlvisible(true, "id:myvisible")) : traceprint(运行状态)
- delay(1000)
-
-
- '判断元素是否启用
- call plugin.smweb.tabgo("#htmlisenabled") : delay(1000)
- tips("【是否启用】:" & plugin.smweb.htmlisenabled("[id='myisenabled']")) : traceprint(运行状态)
- delay(1000)
-
-
- '判断元素是否显示
- call plugin.smweb.tabgo("#htmlisvisible") : delay(1000)
- tips("【是否显示】:" & plugin.smweb.htmlisvisible("[id='myisvisible']")) : traceprint(运行状态)
- delay(1000)
-
-
- '保存验证码图片
- call plugin.smweb.tabgo("#htmlimage") : delay (1000)
- tips ("【保存验证码】:c:\yzm.jpg") : traceprint (运行状态)
- call plugin.smweb.htmlimage("c:\yzm.jpg", "id:myimage")
- delay (1000)
-
-
- '获取元素坐标
- call plugin.smweb.tabgo("#htmloffset") : delay (1000)
- tips ("【元素坐标】:" & plugin.smweb.htmloffset("id:myoffset")) : traceprint (运行状态)
- delay (1000)
-
-
- '获取 css 选择器
- call plugin.smweb.tabgo("#htmlreadcss") : delay(1000)
- tips("【css 选择器】:" & plugin.smweb.htmlreadcss("body > table:nth-child(71) > tbody > tr:nth-child(6) > td > input")) : traceprint(运行状态)
- delay(1000)
-
-
- '获取 xpath 选择器
- call plugin.smweb.tabgo("#htmlreadxpath") : delay(1000)
- tips("【xpath选择器】:" & plugin.smweb.htmlreadxpath("/html/body/table[72]/tbody/tr[6]/td/input")) : traceprint(运行状态)
- delay(1000)
-
-
- '获取 wqm 选择器
- call plugin.smweb.tabgo("#htmlreadwqm") : delay(1000)
- tips("【wqm 选择器】:" & plugin.smweb.htmlreadwqm("tag:input&index:29")) : traceprint(运行状态)
- delay(1000)
-
-
- '设置表格内容
- call plugin.smweb.tabgo("#mytable") : delay(1000)
- tips("【设置1行一列】:神梦无痕") : traceprint(运行状态)
- call plugin.smweb.htmltable(0, 1, 1, "神梦无痕", "#mytable")
- delay(1000)
- tips("【设置2行一列】:小雪") : traceprint(运行状态)
- call plugin.smweb.htmltable(0, 2, 1, "小雪", "//*[@id='mytable']")
- delay(1000)
- tips("【设置3行二列】:女") : traceprint(运行状态)
- call plugin.smweb.htmltable(0, 3, 2, "女", "id:mytable")
- delay(1000)
-
-
- '获取表格内容
- call plugin.smweb.tabgo("#mytable") : delay(1000)
- tips ("【获取1行一列】:" & plugin.smweb.htmlgettable(0, 1, 1, "#mytable")) : traceprint (运行状态)
- delay(1000)
- tips ("【获取2行一列】:" & plugin.smweb.htmlgettable(0, 2, 1, "//*[@id='mytable']")) : traceprint (运行状态)
- delay(1000)
- tips("【获取3行二列】:" & plugin.smweb.htmlgettable(0, 3, 2, "id:mytable")) : traceprint(运行状态)
- delay(1000)
-
-
- '获取列表内容
- call plugin.smweb.tabgo("#htmlgetlist") : delay(1000)
- tips ("【获取索引 0 内容】:" & plugin.smweb.htmlgetlist(0, "#mygetlist")) : traceprint (运行状态)
- delay(1000)
- tips ("【获取索引 1 内容】:" & plugin.smweb.htmlgetlist(1, "//*[@id='mygetlist']")) : traceprint (运行状态)
- delay(1000)
- tips("【获取索引 2 内容】:" & plugin.smweb.htmlgetlist(2, "id:mygetlist")) : traceprint(运行状态)
- delay (1000)
-
-
- '退出浏览器
- call plugin.smweb.tabgo("#quit") : delay(1000)
- tips("正在退出浏览器!") : traceprint(运行状态)
- call plugin.smweb.quit()
- delay (1000)
- next
- msgbox "脚本执行完毕!"
- sub tips(提示)
- 运行状态 = 提示
- call plugin.msg.tips(提示)
- end sub
复制代码
插件下载qq 群号:百度网盘: 提取码(回复可见):
点评
神梦科技
【神梦教程】填表实战 - 按键精灵讨论自动签到[源码] http://bbs.anjian.com/showtopic-698053-1.aspx
发表于 2022/3/4 23:03:51
|