展开全部
baidu网站首页上点击百度logo进入百度空间:
#include <IE.au3>
$oIE = _IECreate ("http://www.baidu.com", 0, 1, 1)
Sleep(2000)
_IEImgClick ($oIE, "http://www.baidu.com/img/baidu_sylogo1.gif")
#include <IE.au3>
$oIE = _IECreate ("http://www.baidu.com", 0, 1, 1)
Sleep(2000)
_IEImgClick ($oIE, "http://www.baidu.com/img/baidu_sylogo1.gif")
追问
这个代码在baidu上确实可用,可是在我们局域网中自建的一个网站根据这个代码变更后去执行却没什么反应!该网站是有带端口的(不知道这个有没有关系)!该图片按钮的源码:onMouseDown="window.event.srcElement.src='images/login/test.jpg'" ,还有没有其它模拟鼠标点击的代码,但是不要那种带位置的,因为不同的浏览器经常位置是不同的!
追答
现成可用的函数,我所知道的只有这个。
_IEImgClick ($oIE, "http://www.baidu.com/img/baidu_sylogo1.gif")
这里的第二个参数:
可以是 图片的url(我例子里就是用的url),
也可以是图片名称,
还可以是图片的替换文本(即图片在浏览器中load不出来时显示的替代文本)。
展开全部
有个点图像的UDF函数的:
_IEImgClick(ByRef $o_object, $s_linkText, $s_mode = "src", $i_index = 0, $f_wait = 1)
; #FUNCTION# ====================================================================================================================
; Name...........: _IEImgClick
; Description ...: Simulate a mouse click on an image. Match by sub-string match of alt text, name or src
; Parameters ....: $o_object - Object variable of an InternetExplorer.Application, Window or Frame object
; $s_linkText - Text to match the content of the attribute specified in $s_mode
; $s_mode - Optional: specifies search mode
; src = (Default) match the url of the image
; name = match the name of the image
; alt = match the alternate text of the image
; $i_index - Optional: If the img text occurs more than once, specify which instance
; you want to click by 0-based index
; $f_wait - Optional: specifies whether to wait for page to load before returning
; 0 = Return immediately, not waiting for page to load
; 1 = (Default) Wait for page load to complete before returning
; Return values .: On Success - Returns -1
; On Failure - Returns 0 and sets @ERROR
; @ERROR - 0 ($_IEStatus_Success) = No Error
; - 1 ($_IEStatus_GeneralError) = General Error
; - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type
; - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
; - 5 ($_IEStatus_InvalidValue) = Invalid Value
; - 6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout
; - 7 ($_IEStatus_NoMatch) = No Match
; - 8 ($_IEStatus_AccessIsDenied) = Access Is Denied
; - 9 ($_IEStatus_ClientDisconnected) = Client Disconnected
; @Extended - Contains invalid parameter number
; Author ........: Dale Hohm
_IEImgClick(ByRef $o_object, $s_linkText, $s_mode = "src", $i_index = 0, $f_wait = 1)
; #FUNCTION# ====================================================================================================================
; Name...........: _IEImgClick
; Description ...: Simulate a mouse click on an image. Match by sub-string match of alt text, name or src
; Parameters ....: $o_object - Object variable of an InternetExplorer.Application, Window or Frame object
; $s_linkText - Text to match the content of the attribute specified in $s_mode
; $s_mode - Optional: specifies search mode
; src = (Default) match the url of the image
; name = match the name of the image
; alt = match the alternate text of the image
; $i_index - Optional: If the img text occurs more than once, specify which instance
; you want to click by 0-based index
; $f_wait - Optional: specifies whether to wait for page to load before returning
; 0 = Return immediately, not waiting for page to load
; 1 = (Default) Wait for page load to complete before returning
; Return values .: On Success - Returns -1
; On Failure - Returns 0 and sets @ERROR
; @ERROR - 0 ($_IEStatus_Success) = No Error
; - 1 ($_IEStatus_GeneralError) = General Error
; - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type
; - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
; - 5 ($_IEStatus_InvalidValue) = Invalid Value
; - 6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout
; - 7 ($_IEStatus_NoMatch) = No Match
; - 8 ($_IEStatus_AccessIsDenied) = Access Is Denied
; - 9 ($_IEStatus_ClientDisconnected) = Client Disconnected
; @Extended - Contains invalid parameter number
; Author ........: Dale Hohm
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-06-22 · 知道合伙人软件行家
关注
展开全部
模拟鼠标点击?
追问
是的~!在ie上的一个图片按钮,不知道在ie上是不是跟我们普通的按钮可以用同样的代码?或者取到什么id之类进行点击的!?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询