cs158525251 2017-06-27 11:13:42
向这样一段代码如何能用VBS确定点击事件? http://210.22.124.135:9383/unicom/speedtest/index.shtml 原网站
...全文
1086 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
无·法 2017-06-30
  • 打赏
  • 举报
回复
我之前写过一个通用函数:http://bbs.csdn.net/topics/392078403 你要在vb里使用,引入一个webbrowser,然后就好控制了。
getElementsByAttributes(webbrowser1,"onclick='check()'")(0).click
getElementsByAttributes(webbrowser1,"onclick='agreehome();'")(0).click
getElementsByAttributes(webbrowser1,"href='more_test.shtml'")(0).click
getElementsByAttributes(webbrowser1,"href='download_test.shtml'")(0).click
getElementsByAttributes(webbrowser1,"onclick='startTest();'")(0).click
注意控制好它们的时间间隔。
舉杯邀明月 2017-06-30
  • 打赏
  • 举报
回复
X-i-n 2017-06-30
  • 打赏
  • 举报
回复
为啥要点击?直接访问 javascript:check 就行啦。或者Document.parentWindow.execScript("check")
赵4老师 2017-06-29
  • 打赏
  • 举报
回复
http://www.autohotkey.com ? 按键精灵 ? API SendInput ?
无·法 2017-06-28
  • 打赏
  • 举报
回复
你这是找人做软件啊。 报个价吧,大家公平接单
cs158525251 2017-06-28
  • 打赏
  • 举报
回复
<div class="bb"> <a onclick="check()" style="cursor: pointer;"> </a> </div> 抓取第一个按钮 <div class="bb"> <input type="button" class="button_a" value="同  意" onclick="agreehome();" style="cursor: pointer;" />    <input type="button" class="button_a" value="不同意" onclick="rethome()" style="cursor: pointer;" /> </div>抓取第二个按钮 <a href="more_test.shtml" class="aa">继 续</a>抓取第三个按钮 <a href="download_test.shtml" class="button_e"><img src="../images/icon05.gif" /><span class="aa">下载测速</span> <p class="clear bb">您可以通过下载测速功能测出宽带的近似速度</p> </a> 抓取第四个按钮 <a href="#" class="button_b fb" id="startTest" onclick="startTest();">开始</a><a href="#" class="button_b fb" id="stopTest" onclick="stopTest();">取消</a> 抓取地五个按钮
cs158525251 2017-06-28
  • 打赏
  • 举报
回复
好像是的,您能做个模拟点击吗?我定位不到这个东西
赵4老师 2017-06-28
  • 打赏
  • 举报
回复
asp ?
cs158525251 2017-06-28
  • 打赏
  • 举报
回复
例如其他网站的自动登陆 自动填写账号密码,啥的我都做出来了,就是这个网站 自动抓包如何弄,请老师指点下,如何确定定位到元素并触发点击事件,,找ID 标签 是已经行不通的
cs158525251 2017-06-28
  • 打赏
  • 举报
回复
其实不难我就想知道如何抓到那个网页元素,我就是不知道方法罢了
无限级树(Java递归) 2007-02-08 10:26 这几天,用java写了一个无限极的树,递归写的,可能代码不够简洁,性能不够好,不过也算是练习,这几天再不断改进。前面几个小图标的判断,搞死我了。 package com.nickol.servlet; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.nickol.utility.DB; public class category extends HttpServlet { /** * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("utf-8"); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out .println(""); out.println(""); out.println(" Category" + "" + "body{font-size:12px;}" + "" + "" + ""); out.println(" "); out.println(showCategory(0,0,new ArrayList(),"0")); out.println(" "); out.println(""); out.flush(); out.close(); } public String showCategory(int i,int n,ArrayList frontIcon,String countCurrent){ int countChild = 0; n++; String webContent = new String(); ArrayList temp = new ArrayList(); try{ Connection conn = DB.GetConn(); PreparedStatement ps = DB.GetPs("select * from category where pid = ?", conn); ps.setInt(1, i); ResultSet rs = DB.GetRs(ps); if(n==1){ if(rs.next()){ webContent += "";//插入结尾的减号 temp.add(new Integer(0)); } webContent += "&nbsp;";//插入站点图标 webContent += rs.getString("cname"); webContent += "\n"; webContent += showCategory(Integer.parseInt(rs.getString("cid")),n,temp,"0"); } if(n==2){ webContent += "\n"; }else{ webContent += "\n"; } while(rs.next()){ for(int k=0;ker)frontIcon.get(k)).intValue(); if(iconStatic == 0){ webContent += "";//插入空白 }else if(iconStatic == 1){ webContent += "";//插入竖线 } } if(rs.isLast()){ if(checkChild(Integer.parseInt(rs.getString("cid")))){ webContent += "";//插入结尾的减号 temp = (ArrayList)frontIcon.clone(); temp.add(new Integer(0)); }else{ webContent += "";//插入结尾的直角 } }else{ if(checkChild(Integer.parseInt(rs.getString("cid")))){ webContent += "";//插入未结尾的减号 temp = (ArrayList)frontIcon.clone(); temp.add(new Integer(1)); }else{ webContent += "";//插入三叉线 } } if(checkChild(Integer.parseInt(rs.getString("cid")))){ webContent += "&nbsp;";//插入文件夹图标 }else{ webContent += "&nbsp;";//插入文件图标 } webContent += rs.getString("cname"); webContent += "\n"; webContent += showCategory(Integer.parseInt(rs.getString("cid")),n,temp,countCurrent+countChild); countChild++; } webContent += "\n"; DB.CloseRs(rs); DB.ClosePs(ps); DB.CloseConn(conn); }catch(Exception e){ e.printStackTrace(); } return webContent; } public boolean checkChild(int i){ boolean child = false; try{ Connection conn = DB.GetConn(); PreparedStatement ps = DB.GetPs("select * from category where pid = ?", conn); ps.setInt(1, i); ResultSet rs = DB.GetRs(ps); if(rs.next()){ child = true; } DB.CloseRs(rs); DB.ClosePs(ps); DB.CloseConn(conn); }catch(Exception e){ e.printStackTrace(); } return child; } } --------------------------------------------------------------------- tree.js文件 function changeState(countCurrent,countChild){ var object = document.getElementById("level" + countCurrent + countChild); if(object.style.display=='none'){ object.style.display='block'; }else{ object.style.display='none'; } var cursor = document.getElementById("cursor" + countCurrent + countChild); if(cursor.src.indexOf("images/tree_minus.gif")>=0) {cursor.src="images/tree_plus.gif";} else if(cursor.src.indexOf("images/tree_minusbottom.gif")>=0) {cursor.src="images/tree_plusbottom.gif";} else if(cursor.src.indexOf("images/tree_plus.gif")>=0) {cursor.src="images/tree_minus.gif";} else {cursor.src="images/tree_minusbottom.gif";} var folder = document.getElementById("folder" + countCurrent + countChild); if(folder.src.indexOf("images/icon_folder_channel_normal.gif")>=0){ folder.src = "images/icon_folder_channel_open.gif"; }else{ folder.src = "images/icon_folder_channel_normal.gif"; }

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧