|
本帖最后由 jhkdqaa 于 2009-5-13 11:59 编辑
关于一个php的网页。新手上路,大侠们帮忙看看
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$Form1 = GUICreate("每日自动刷新",700,480)
$Group1 = GUICtrlCreateGroup("", 8, 8, 684, 400)
$oIE = _IECreateEmbedded ()
$GUIActiveX = GUICtrlCreateObj($oIE,16, 24, 668, 374)
$Edit = GUICtrlCreateEdit("", 8, 420, 500,50)
GUICtrlSetBkColor(-1, 0xFFFFE1)
GUICtrlSetColor(-1, 0x008000)
$Button1 = GUICtrlCreateButton("首 页", 516, 420, 84, 50)
$Button2 = GUICtrlCreateButton("刷 新", 608, 420, 84, 50)
GUISetState(@SW_SHOW)
$oIE.navigate("http://www.asianproducts.com/")
GUICtrlSetData($Edit,"请自行设置用户名和密码登陆")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$oIE.navigate("http://www.asianproducts.com/")
Case $Button2
$UserName = _IEGetObjById ($oIE, "client_login_name")
If IsObj($UserName) Then $UserName.value = "留着以后读数据库"
$PassWord = _IEGetObjById ($oIE, "client_login_password")
If IsObj($PassWord) Then $PassWord.value = "留着以后读数据库"
$submit = _IEGetObjById ($oIE, "button")
If IsObj($submit) Then $submit.click
sleep(2000)
GUICtrlSetData($Edit,"请稍后,正在操作...")
_IELoadWait($oIE)
GUICtrlSetData($Edit,"已登陆")
$oIE.navigate("http://www.asianproducts.com/member.php")
_IELoadWait($oIE)
_IELinkClickByText($oIE,"My online products")
_IELoadWait($oIE)
_IEImgClick($oIE,"http://www.asianproducts.com/clientAdmin/images/big_icon3_smaller.gif","src")
_IELoadWait($oIE)
_IEImgClick($oIE,"http://www.asianproducts.com/clientAdmin/images/save_data1.gif","src")
EndSwitch
WEnd
问题就是这个网页有N个长的一样的图片链接,怎样通过_IEImgGetCollection逐个点击?只需要针对第一个图片链接就可以了。坐等高手帮忙 |
|