vrsrinivas2000 Posted May 4, 2017 Share Posted May 4, 2017 #include <IE.au3>#include <MsgBoxConstants.au3>Local $oIE = _IE_Example("basic")Local $oLinks = _IELinkGetCollection($oIE)Local $iNumLinks = @extendedLocal $sTxt = $iNumLinks & " links found" & @CRLF & @CRLFFor $oLink In $oLinks $sTxt &= $oLink.href & @CRLFNextMsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt) This is work for only this url, But did not work other urls like "https://tools.usps.com/go/ZipLookupAction!input.action" I get the error as below Variable must be of type "Object".: For $oLink In $oLinks For $oLink In $oLinks^ ERROR Please suggest. Link to comment Share on other sites More sharing options...
Subz Posted May 4, 2017 Share Posted May 4, 2017 Try adding _IELoadWait($oIE) after "Local $oIE = .... Link to comment Share on other sites More sharing options...
Trong Posted May 4, 2017 Share Posted May 4, 2017 Try: #include <IE.au3> #include <MsgBoxConstants.au3> Global Const $iLink = "https://tools.usps.com/go/ZipLookupAction!input.action" Local $oIE = _IECreate($iLink) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "!", "_IECreate Error: " & @error) Local $oLinks = _IELinkGetCollection($oIE) Local $iError = @error Local $iNumLinks = @extended If Not $iError And IsObj($oLinks) Then Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF For $oLink In $oLinks $sTxt &= $oLink.href & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt) Else Exit MsgBox($MB_SYSTEMMODAL, "!", "Get Link Error: " & $iError) EndIf Regards, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now