本人菜鸟一枚。
想用VB实现图上按钮的自动点击,实际中,鼠标移动有字的按钮上点击,就可以执行相应的程序。已取得网页源代码,但没有“input"、也没有”button",不知道该怎么,请教大佬们。
网页代码如下:
<HEAD><TITLE>首页</TITLE>
<META charset=UTF-8><LINK href="style.css" rel=stylesheet type=text/css>
<SCRIPT src="jquery-1.11.2.min.js" type=text/javascript></SCRIPT>
<SCRIPT src="main.js" type=text/javascript></SCRIPT>
</HEAD>
<BODY>
<DIV id=box style="WIDTH: 1366px; MARGIN-TOP: -313px; MARGIN-LEFT: -683px" jQuery11120020736564877366248="17">
<IMG style="WIDTH: 1366px" src="images/normal/湘财_01.png" pos="01">
<IMG style="WIDTH: 833px" src="images/normal/湘财_02.png" pos="02">
<IMG class=link style="WIDTH: 71px" src="images/normal/湘财_03.png" pos="03" jQuery11120020736564877366248="1">
<IMG style="WIDTH: 461px" src="images/normal/湘财_04.png" pos="04">
<IMG style="WIDTH: 390px" src="images/normal/湘财_05.png" pos="05">
<IMG class=link style="WIDTH: 91px" src="images/normal/湘财_06.png" pos="06" jQuery11120020736564877366248="3">
<IMG style="WIDTH: 884px" src="images/normal/湘财_07.png" pos="07">
<IMG style="WIDTH: 906px" src="images/normal/湘财_08.png" pos="08">
<IMG class=link style="WIDTH: 95px" src="images/normal/湘财_09.png" pos="09" jQuery11120020736564877366248="4">
<IMG style="WIDTH: 363px" src="images/normal/湘财_10.png" pos="10">
<IMG style="WIDTH: 390px" src="images/normal/湘财_11.png" pos="11">
<IMG class=link style="WIDTH: 106px" src="images/normal/湘财_12.png" pos="12" jQuery11120020736564877366248="5">
<IMG style="WIDTH: 62px" src="images/normal/湘财_13.png" pos="13">
</DIV></BODY>
最简单的,放在webbrowser里,用sendkeys上下左右移动焦点,再模拟回车实现点击
网页里有很多任务是在JavaScript脚本文件里做的。比如你这个网页,就有
<SCRIPT src="jquery-1.11.2.min.js" type=text/javascript></SCRIPT>
<SCRIPT src="main.js" type=text/javascript></SCRIPT>
引用了两个JavaScript脚本文件xxx.js,你需要获取这两个文件的源代码,看里面创建了一些什么界面对象及其事件处理。
<IMG style="WIDTH: 1366px" src="images/normal/湘财_01.png" pos="01">
拿到源码了,应该是没有拿到图片资源,把图片也下载下来放到指定路径应该就可以了