# Webpage status check

## Recommended Posts

Hey all, i'm trying to use the IE udf to determine the status of my online banking.  Basically I'm trying to bring up the login page and use that as part of my check.

I'm using beta 3.3.9 with the newest IE udf from 3/13.

So this is the code I have.... (very small at this point and time)

#include <ie.au3>

$URL = "https://secure.ambankiowa.com/pbi_pbi1961/pbi1961.ashx?Rt=073917641&LogonBy=Connect3&PRMAccess=Portfolio" Local$oIE = _IECreate($URL) MsgBox(1,"Error",@EXTENDED) Exit The problem is, _IELoadWait never returns. It eventually times out. Now, I read something about it possibly being XML related, but I'm not quite sure. Any ideas would be appreciated. #### Share this post ##### Link to post ##### Share on other sites Hey, This is working for me on IE9 and latest official release of autoit. #include <ie.au3>$URL = "https://secure.ambankiowa.com/pbi_pbi1961/pbi1961.ashx?Rt=073917641&LogonBy=Connect3&PRMAccess=Portfolio"

Local $oIE = _IECreate($URL, -1, -1, 1)
if $oIE <> 0 then msgbox(1,"Info", "Page loaded successfully!") else msgbox(1,"Info", "Error loading webpage. Error code "& @error) endif Does it work for you as well? Edited by Neutro #### Share this post ##### Link to post ##### Share on other sites Huh... I have IE9 too. Now, I should say too that I am on a 64 bit version of Win 7, but running the 32 bit version of AutoIT. When I run the script I get this warning: --> IE.au3 T3.0-0 Warning from function _IEAttach,$_IEStatus_NoMatch

but it just sits and does nothing.

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "U:\My Documents\Projects\autoit\Online Banking Verification\test.au3" /UserParams
+>07:54:43 Starting AutoIt3Wrapper v.2.1.0.8    Environment(Language:0409  Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.9.4)  from:C:\Program Files (x86)\AutoIt3\beta
+>07:54:44 AU3Check ended.rc:0
>Running:(3.3.9.4):C:\Program Files (x86)\AutoIt3\beta\autoit3.exe "U:\My Documents\Projects\autoit\Online Banking Verification\test.au3"
--> IE.au3 T3.0-0 Warning from function _IEAttach, $_IEStatus_NoMatch Just don't know why it's returning$_IEStatus_NoMatch

##### Share on other sites

I ran the code in your basenote without trouble on

1) Windows 7, 32bit, IE 10, AutoIt 3.3.9.4 and the T3.0-0 version of IE.au3

2) Windows 7, 64bit, IE 8, AutoIt 3.3.9.4 and the T3.0-0 version of IE.au3

(it ran and returned quickly).

I don't have the specific config you have and I can't guess what your trouble might be.  Perhaps an intermittent problem with the website?

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

Automate input type=file (Related)

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

##### Share on other sites

I tend to use this for checking the status of webpages as it can get you the status text and status code (eg, 404 not found, 401 Not authorised, etc)

ConsoleWrite("Checking Bank: " & _GetURLStatus("https://secure.ambankiowa.com/pbi_pbi1961/pbi1961.ashx?Rt=073917641&LogonBy=Connect3&PRMAccess=Portfolio") & :@CRLF)

Func _GetURLStatus($inURL) Local$val = ""

Local $objHTTP = ObjCreate("MSXML2.ServerXMLHTTP.6.0")$objHTTP.Open("GET", $inURL, false) ; Uncomment next 4 lines if using a proxy server ;Local$proxyserver  = "" ; add proxy server name
;Local $proxyport = "" ; add proxy server port ;Local$ProxyExceptions = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride") ; get any proxy exceptions
;$objHTTP.setProxy("2",$proxyserver & ":" & $proxyport,$ProxyExceptions)

$objHTTP.Send(" ") ; Check the status code of the request If$objHTTP.status = "200" Then
$val =$objHTTP.statusText
Else
$val =$objHTTP.statustext & " (" & $objHTTP.status & ")" EndIf Return$val

EndFunc



NiVZ

Edited by NiVZ

## Create an account

Register a new account

• ### Similar Content

• I've tried for a few days to simply open a url in IE and click an IE object that I can't "TAB" to and don't want to use a mouse-click if at all possible.  I've read up on things like using IEAction and IETagNameGetCollection to find the object but not smart enough to figure out how that works with my url or how to tell if my url is "basic" or a "form", "frameset", "iframe", etc.
The other problem is I've tried using the "Run" and "ShellExecute" commands to open the browser, which works, but it opens it in a way that doesn't include my currently logged in user account.  For example, if I just click IE or Chrome for that matter and open my default homepage of google, the page that opens knows I'm logged in.  When I use "Send" "ShellExecute" or "_IE_Create" they always open pages generically which would require a login.
So questions are, if I have a URL I'm trying to open, that's passes the currently logged on users credentials when opening the page (no clue where that happens)
1.  Are there any code examples someone is willing to share that opens my IE maximized, with logged in credentials, and
2.  Once that works, can someone suggest a technique a non-developer can find which IE Objects I need to send a "click" to so it opens the correct menu, pop-up, url, etc., associated with that object.  I've copied what doesn't work and sure I'm way off but it's not for a lack of effort. I'll keep trying and post updates but not looking good 🙂
#include <IE.au3>
Call ("selection")
Func selection ()
Global $oIE = _IECreate ("https://internal-webpage.aspx") Local$selectid = _IEGetObjByName ($oIE, "signageNo") Local$button = _IEGetObjByName ($oIE, "GO") _IEFormElementOptionSelect ($selectid, "3")
_IEAction ($button,"click") EndFunc #include <IE.au3> Call ("selection") Func selection () Global$oIE = _IECreate ("https://internal-webpage.aspx") Local $selectid = _IEGetObjByName ($oIE, "signageNo") Local $button = _IEGetObjByName ($oIE, "GO") _IEFormElementOptionSelect ($selectid, "3") _IEAction ($button,"click") EndFunc 1.

• I want to set the value of a input, but I only have the input name and input id.  I cannot find a form in the source.  Form collection does not return any results.
Is there a way to use FormElementSetValue without a form name? Can I use _IEGetObjByName or _IEGetObjById?  If so, how do I set the value once I have the object? Where do I go from here? Local $oIE = _IEAttach("[Website Goes Here"]) Local$oForm = _IEFormGetCollection($oIE, 1) Local$oQuery = _IEFormElementGetCollection($oForm, 4) _IEFormElementSetValue($oQuery, "Set it to this")
• By VinMe
Dear all, i am unable to open a xml file to excel in the "xml table format" Please help me out in where i am missing
Local $strFileToOpen = _WinAPI_OpenFileDlg('Select xml file', @WorkingDir, 'All Files(*.*)', 1, '', '', BitOR($OFN_PATHMUSTEXIST, $OFN_FILEMUSTEXIST,$OFN_HIDEREADONLY)) Global $xlXmlLoadImportToList = 2 ; Places the contents of the XML data file in an XML table$oExcel = _Excel_Open() $oWorkbook1=$oExcel.Workbooks.OpenXML($strFileToOpen, "",$xlXmlLoadImportToList) If $strFileToOpen <> False Then Local$oWorkbook1 = _Excel_BookOpen($oExcel,$strFileToOpen) EndIf Error i am getting is:
......\81e_Compare_v1.au3" (46) : ==> The requested action with this object has failed.:
$oWorkbook1=$oExcel.Workbooks.OpenXML($strFileToOpen, "",$xlXmlLoadImportToList)
$oWorkbook1=$oExcel.Workbooks^ ERROR
>Exit code: 1    Time: 7.338
• By Seminko
Hey there,
below function returns an "object collection" (not sure if that's the correct term) of 'a' elements grabbed from within //*[@id="J_DetailMeta"].
However, I need the returned collection not to include objects with 'aria-disabled = true'. Is there a way of removing specific objects from such a collection?
Func GetObjectList($sPicker)$oDetailMeta = _IEGetObjById($oIE, "J_DetailMeta") If Not @error Then$tags = $oDetailMeta.GetElementsByTagName("ul") For$tag in $tags$data_ID_value = $tag.GetAttribute("data-property") If$sPicker = "color" Then If $data_ID_value = '????' Or$data_ID_value = "????" Then $oReturnList =$tag.GetElementsByTagName("a") EndIf ElseIf $sPicker = "network" Then If$data_ID_value = '????' Then $oReturnList =$tag.GetElementsByTagName("a") EndIf ElseIf $sPicker = "storage" Then If$data_ID_value = '????' Then $oReturnList =$tag.GetElementsByTagName("a") EndIf EndIf Next EndIf Return $oReturnList EndFunc$oColorList = GetObjectList("color") For $oColor In$oColorList If StringInStr($oColor.GetAttribute("aria-disabled"), "true") <= 0 Then ; remove object from the collection ??? EndIf Next • I have been using the XML UDF successfully for sometime. I am now tring to add in error handling for some bad XML files I run into.$oXmlDoc = _XML_CreateDOMDocument(Default) _XML_Load($oXmlDoc,$sFileXML) ;<== ENTER XML FILE PATH HERE If @error Then ; ConsoleWrite(StringFormat("_XML_load error - @error = %s", @error) & @CRLF) ; ConsoleWrite("-" & $sFileXML & @CRLF) Exit -1 EndIf ConsoleWrite("-" &$sFileXML & @CRLF) ;If no specified nodes exist, log error and exit If Not _XML_NodeExists($oXmlDoc, "//Property") Then ; ConsoleWrite("No specified nodes exist" & @CRLF) Exit -1 EndIf ;Get number of Property nodes$oProperties = _XML_SelectNodes($oXmlDoc,"//Property/Data")$iNodeCount = @extended $oParents =$oXmlDoc.SelectSingleNode("//Property[@Name='Parents']/Data") There are no error upto this point. The XML file I am trying to handle has a Data node but when I try to
$sParam = StringSplit($oParents.text, ";") I get a fatal error (requested action on object failed). How can I test for the problem before I try to do the string split? I tried using @error, and testing \$oParents but no luck.
Appreciate any tips.
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...