dar100111 Posted July 17, 2013 Share Posted July 17, 2013 (edited) I am able to find this element<input name="NO" onkeyup="this.value = this.value.toUpperCase();" onkeypress="IsEngorInt(event)" type="text" size="20" maxlength="12" value=""/>From my Code below. There's no error finding the $input or formname either. I made sure my $masterbill is pulling ok too, with the msgbox. Has anyone ran into any issues like this? Thanks! Also curious how everyone pastes their code on the message boards where it can be scrolled through. I've just been pasting the text.#include <IE.au3>#include <Excel.au3>#include <Array.au3>$row = 3$value = InputBox("Steam Vessel Tracking Script", " ENTER ACTION TO PERFORM"&@lf&@LF&"1. Track Shipments"&@lf&"2. Input CFIT Information"&@lf&"3. "&@lf&"4. "&@lf&" ", "*", " M1")If @error = 1 Then Exit; Cancel button pressed$oExcel = _ExcelBookOpen("F:EIDFWNATOracle NMCNMC DevelopmentNetwork AnalystReportsautoitSteam Trac Tool.xlsx")$aArray = _ExcelReadSheetToArray($oExcel)$counter = $aArray[0][0]$oIE = _IECreate("http://www.shipmentlink.com/servlet/TDB1_CargoTracking.do",0,1,1)If $value = 1 ThenDo$masterbill = $aArray[$row][1]$oForm = _IEFormGetObjByName($oIE, "frmCargo");enter the form id or name$input = _IEFormElementGetObjByName($oForm, "NO")MsgBox("", "", $masterbill)_IEFormElementSetValue($input, $masterbill)#include <IE.au3>$oButtons = _IETagNameGetCollection($oIE, "INPUT")For $oButton In $oButtonsIf String($oButton.type) = "button" Then; Save the current element to a variable$oButton2Save = $oButton; Exit the for loop now that we have found the go buttonExitLoopEndIfNext_IEAction($oButton2Save, "click")_IELoadWait($oie)$row = $row + 1_IENavigate($oIE, "http://www.shipmentlink.com/servlet/TDB1_CargoTracking.do",1)_IELoadWait($oie)Until $row = $counter + 1MsgBox("","Information Gathered", "All Shipments Tracked")EndIf Edited July 17, 2013 by dar100111 Link to comment Share on other sites More sharing options...
DW1 Posted July 17, 2013 Share Posted July 17, 2013 $input = _IEFormElementGetObjByName($oForm, "NO", 5) Your code was working, but it was populating the first box in the "multiple tracking" tab, as that was the first match in the source. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
dar100111 Posted July 17, 2013 Author Share Posted July 17, 2013 Great that works. I'm dumbfounded because I went back and looked at the HTML, how did you know it was the 5th instance? I used the selector tool with IE and I really couldn't tell. Link to comment Share on other sites More sharing options...
Solution DW1 Posted July 17, 2013 Solution Share Posted July 17, 2013 (edited) Looking at the page source there are five (name="NO") before the one you wanted (instances 0-4) <input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();"> <input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();"> <input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();"> <input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();"> <input type="text" name="NO" size="16" maxlength="12" value="" onKeyPress="IsEngorInt(event)" onKeyUp="this.value = this.value.toUpperCase();"> Edited July 17, 2013 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
dar100111 Posted July 17, 2013 Author Share Posted July 17, 2013 Again thanks for you help Dan! You rock! 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