标题: 如何实现点击页面中的所有link [打印本页] 作者: deadhunter 时间: 2011-1-12 16:30 标题: 如何实现点击页面中的所有link Dim oDesc,colObject
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
Set colObject = Browser( "title:=Google").Page("title:=Google").ChildObjects( oDesc )
For x = 0 to colObject.Count - 1
'MsgBox colObject(x).GetROProperty("innertext")
colObject(x).Click
wait(2)
'点击第一个link时页面跳转到其它页面,需要返回当前首页
SystemUtil.Run "IEXPLORE.EXE","http://www.google.com.hk"
wait(2)
Next
上面已经获取到所有的link,但是实现click时就报错,请教大师们要如何实现?作者: deadhunter 时间: 2011-1-12 16:45
Dim oDesc,colObject
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
Set colObject = Browser( "title:=Google").Page("title:=Google").ChildObjects( oDesc )
Set ieBrowser = CreateObject("InternetExplorer.Application")
For x = 0 to colObject.Count - 1
'MsgBox colObject(x).GetROProperty("innertext")
colObject(x).Click
wait(2)
'SystemUtil.Run "IEXPLORE.EXE","http://www.google.com.hk"
ieBrowser.Navigate "http://www.google.com.hk"
wait(2)
Next
我用当前页面打开时,ieBrowser.Navigate "http://www.google.com.hk",这个不能执行作者: superliming 时间: 2011-1-14 13:20
Dim oDesc,colObject
Set oAutoIt = CreateObject("AutoItX3.Control")
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
Set colObject=Browser("百度一下,你就知道").Page("百度一下,你就知道").ChildObjects(oDesc)
Browser("百度一下,你就知道").Page("百度一下,你就知道").Sync
Setting.WebPackage("ReplayType") = 2
For i = 0 to colObject.Count - 1
' MsgBox colObject(i).GetROProperty("innertext")
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
Set ieBrowser=Browser( "Index:=0")
Set colObject = Browser( "title:=Google").Page("title:=Google").ChildObjects( oDesc )
For x = 0 to colObject.Count - 1
Set colObject = Browser( "title:=Google").Page("title:=Google").ChildObjects( oDesc )