Jump to content
taylansan

Another iFrame and element question

Recommended Posts

taylansan

Hello,
I'm trying to set the value of an input value in an iframe which is a cross reference.

Here is my code:

$oFrame = _IEFrameGetObjByName($oIE, "AID_1460048722447_iframe")
If @error Then
    ConsoleWrite("Cannot get this frame" & @CRLF)
EndIf
If Not IsObj($oFrame) Then
    ConsoleWrite("Frame was not found" & @CRLF)
EndIf

;try each item one by one
$o1 = _IEGetObjById($oFrame, "serviceNo_input_value")
$o2 = _IEGetObjByName($oFrame, "searchCond.serviceNo")
$o3 = _IEFrameGetObjByName($oFrame, "searchCond.serviceNo")
$o4 = _IEFormGetObjByName($oFrame, "searchCond.serviceNo")
$o5 = _IEFormElementGetObjByName($oFrame, "searchCond.serviceNo")

This is the output for each $o1 to $o5 trying:

;result for $o1
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Program Files\AutoIt3\Include\IE.au3" (1899) : ==> The requested action with this object has failed.:
If IsObj($oObject.document.getElementById($sID)) Then
If IsObj($oObject^ ERROR
->00:08:17 AutoIt3.exe ended.rc:1
+>00:08:17 AutoIt3Wrapper Finished.

;result for $o2
"C:\Program Files\AutoIt3\Include\IE.au3" (1875) : ==> The requested action with this object has failed.:
If IsObj($oObject.document.GetElementsByName($sName).item($iIndex)) Then
If IsObj($oObject^ ERROR
->00:09:49 AutoIt3.exe ended.rc:1
+>00:09:49 AutoIt3Wrapper Finished.

;result for $o3
"C:\Program Files\AutoIt3\Include\IE.au3" (704) : ==> The requested action with this object has failed.:
$oTemp = $oObject.document.parentWindow
$oTemp = $oObject^ ERROR
->00:10:18 AutoIt3.exe ended.rc:1
+>00:10:18 AutoIt3Wrapper Finished.

;result for $o4
"C:\Program Files\AutoIt3\Include\IE.au3" (930) : ==> The requested action with this object has failed.:
Local $oCol = $oObject.document.forms.item($sName)
Local $oCol = $oObject^ ERROR
->00:10:33 AutoIt3.exe ended.rc:1
+>00:10:33 AutoIt3Wrapper Finished.

;result for $o5
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType
+>00:10:49 AutoIt3.exe ended.rc:0
+>00:10:49 AutoIt3Wrapper Finished.

I have also checked these posts for reference, but I'm missing something which I cannot find.

I don't know how to copy the content of this html at once, so I provided in screenshot. Is there a way that I can get this element?

Source.png


TY.

Share this post


Link to post
Share on other sites
Juvigy

First - check if you got the correct iframe.

Then try something like this :
 

$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    ;check here for the correct iframe
Next

 

Share this post


Link to post
Share on other sites
taylansan

I have tried like this:

$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
ConsoleWrite("Total Frames: " & $iNumFrames & @CRLF)
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    ;check here for the correct iframe
    If $oFrame.name <> "" Then ;ignore the empty names
        ConsoleWrite($oFrame.name & @CRLF)
    EndIf
Next

I have a lot of empty frames, and two frames only; home frame and AID_... Output is like that:

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Total Frames: 142
home_iframe
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (18) : ==> The requested action with this object has failed.:
If $oFrame.name <> "" Then
If $oFrame^ ERROR
->12:01:42 AutoIt3.exe ended.rc:1
+>12:01:42 AutoIt3Wrapper Finished.

This is how it looks like, I'm trying to get AID_somenumber:

 

If I use _IEFrameGetCollection I cannot find my frame in the list, it's giving the error. So, I'm thinking that I cannot really get the frame with AID_...

I can find the AID number, how can I get into it? There are some input box which I want to reach.

My Frame DOM.png

My Frame Empty Items.png

Edited by taylansan
Posting the images

TY.

Share this post


Link to post
Share on other sites
Juvigy

Try this script and show me the output:

 

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
ConsoleWrite("Total Frames: " & $iNumFrames & @CRLF)
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    ConsoleWrite("number"&$i&":"&$oFrame.name & @CRLF)
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

Share this post


Link to post
Share on other sites
taylansan

Hi Juvigy,

Here is the output. All of the frames are blank. There is one home frame:

>"C:\Program Files\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" /UserParams    
+>15:21:03 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X86  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files\AutoIt3\SciTE   UserDir => C:\Users\t00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\t00722811\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3
+>15:21:03 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Total Frames: 142
number0:
number1:
number2:
number3:
number4:
number5:
number6:
number7:
number8:
number9:
number10:
number11:
number12:
number13:
number14:
number15:
number16:
number17:
number18:
number19:
number20:
number21:
number22:
number23:
number24:
number25:
number26:
number27:
number28:
number29:
number30:
number31:
number32:
number33:
number34:
number35:
number36:
number37:
number38:
number39:
number40:
number41:
number42:
number43:
number44:
number45:
number46:
number47:
number48:
number49:
number50:
number51:
number52:
number53:
number54:
number55:
number56:
number57:
number58:
number59:
number60:
number61:
number62:
number63:
number64:
number65:
number66:
number67:
number68:
number69:
number70:
number71:
number72:
number73:
number74:
number75:
number76:
number77:
number78:
number79:
number80:
number81:
number82:
number83:
number84:
number85:
number86:
number87:
number88:
number89:
number90:
number91:
number92:
number93:
number94:
number95:
number96:
number97:
number98:
number99:
number100:
number101:
number102:
number103:
number104:
number105:
number106:
number107:
number108:
number109:
number110:
number111:
number112:
number113:
number114:
number115:
number116:
number117:
number118:
number119:
number120:
number121:
number122:
number123:
number124:
number125:
number126:
number127:
number128:
number129:
number130:
number131:
number132:
number133:
number134:
number135:
number136:
number137:
number138:
number139:
number140:home_iframe
number141:
+>15:21:06 AutoIt3.exe ended.rc:0
+>15:21:06 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 3.847

In the debugger for IE, I can see the iframe with AID_1460110786614_iframe, but it's not shown in the output. And attached the screenshot.

Thank you very much for your efforts so far.

142 Frames.png


TY.

Share this post


Link to post
Share on other sites
Juvigy

So you will need to get the DIV first , and then the iframe inside.

Try:

        $oArray = $oDoc.getElementsByTagName ("div")
            For $element In $oArray
                    ConsoleWrite( $element.id &@CRLF)
            Next

And look for the AID_16... id.

Share this post


Link to post
Share on other sites
taylansan

Using this, gives the following error that $oDoc not defined:

$oArray = $oDoc.getElementsByTagName("div")
For $element In $oArray
    ConsoleWrite( $element.id & @CRLF)
Next 


>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"(11,44) : warning: $oDoc: possibly used before declaration.
$oArray = $oDoc.getElementsByTagName("div")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"(11,44) : error: $oDoc: undeclared global variable.
$oArray = $oDoc.getElementsByTagName("div")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3 - 1 error(s), 1 warning(s)
!>17:55:41 AU3Check ended. Press F4 to jump to next error.rc:2
+>17:55:41 AutoIt3Wrapper Finished.

The doc variable is not defined, so I changed it with oIE (just for trying - don't know hot to set oDoc):

$oArray = $oIE.getElementsByTagName("div")
For $element In $oArray
    ConsoleWrite( $element.id & @CRLF)
Next


>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (11) : ==> The requested action with this object has failed.:
$oArray = $oIE.getElementsByTagName("div")
$oArray = $oIE^ ERROR
->17:58:04 AutoIt3.exe ended.rc:1
+>17:58:04 AutoIt3Wrapper Finished.

Then tried to get the "div" using normal function:

Local $oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If $oInput.id = "AID_1460110786614" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )

        _IEAction($oInput, "focus") ;trying focus for any luck

        $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
        $oFrames = _IEFrameGetCollection ($oInput)
        $iNumFrames = @extended
        ConsoleWrite("Total Frames: " & $iNumFrames & @CRLF)
        For $i = 0 to ($iNumFrames - 1)
            $oFrame = _IEFrameGetCollection ($oInput, $i)
            ConsoleWrite("number"&$i&":"&$oFrame.name & @CRLF)
        Next

    EndIf
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Okay inside that div: AID_1460110786614
Total Frames: 142
number0:
number1:
number2:
number3:
number4:
number5:
number6:
number7:
number8:
number9:
number10:
number11:
number12:
number13:
number14:
number15:
number16:
number17:
number18:
number19:
number20:
number21:
number22:
number23:
number24:
number25:
number26:
number27:
number28:
number29:
number30:
number31:
number32:
number33:
number34:
number35:
number36:
number37:
number38:
number39:
number40:
number41:
number42:
number43:
number44:
number45:
number46:
number47:
number48:
number49:
number50:
number51:
number52:
number53:
number54:
number55:
number56:
number57:
number58:
number59:
number60:
number61:
number62:
number63:
number64:
number65:
number66:
number67:
number68:
number69:
number70:
number71:
number72:
number73:
number74:
number75:
number76:
number77:
number78:
number79:
number80:
number81:
number82:
number83:
number84:
number85:
number86:
number87:
number88:
number89:
number90:
number91:
number92:
number93:
number94:
number95:
number96:
number97:
number98:
number99:
number100:
number101:
number102:
number103:
number104:
number105:
number106:
number107:
number108:
number109:
number110:
number111:
number112:
number113:
number114:
number115:
number116:
number117:
number118:
number119:
number120:
number121:
number122:
number123:
number124:
number125:
number126:
number127:
number128:
number129:
number130:
number131:
number132:
number133:
number134:
number135:
number136:
number137:
number138:
number139:
number140:home_iframe
number141:
+>18:07:36 AutoIt3.exe ended.rc:0
+>18:07:36 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 7.308

Should I get all the div one by one? div: tabpage_body > div: AID_1460110786614_body > div: AID_1460110786614 > iframe: AID_1460110786614_iframe (according to the previous screenshots)

What am I missing?


TY.

Share this post


Link to post
Share on other sites
MichaelHB

@taylansan can we check some stuff first?

IMPORTANT: please check and recheck the ID's name, make sure they are right. Just use this code, nothing else, open the website you trying to automate, make sure there is no other instance of the IE runnnig, ok?

Try this and post the console output.

#include <IE.au3>

$oIE = _IEAttach("", "instance", 1)
ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)
$1_div = $oIE.document.getElementById("tabpage_body")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_div) & @CRLF)
$1_frame = $oIE.document.getElementById("AID_1460048722447_iframe")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_frame) & @CRLF)
$1_input = $oIE.document.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($1_input) = " & IsObj($1_input) & @CRLF)

ConsoleWrite("------------ #### ------------" & @CRLF)

$2_frame = $oIE.document.getElementById("AID_1460048722447_iframe")
ConsoleWrite("IsObj($2_frame) = " & IsObj($2_frame) & @CRLF)
$2_frame_doc = $2_frame.contentWindow.document
ConsoleWrite("IsObj($2_frame_doc) = " & IsObj($2_frame_doc) & @CRLF)
$2_input = $2_frame_doc.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($2_input) = " & IsObj($2_input) & @CRLF)

Exit

 

Share this post


Link to post
Share on other sites
markyrocks

I'd say give this a try and see if it spits out the data your looking for.   This will most likely needed edited to fit into your script 

#include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IE_Example("basic") Local $sHTML = _IEDocReadHTML($oIE) MsgBox($MB_SYSTEMMODAL, "Document Source", $sHTML) _IEQuit($oIE)

 

Share this post


Link to post
Share on other sites
MichaelHB

@markyrocks i belive he is trying to set input value/text in a form, not trying to read it. :)

Share this post


Link to post
Share on other sites
taylansan

I have only changed the AID_ because it always changes:

$oIE = _IEAttach("", "instance", 1)
ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)
$1_div = $oIE.document.getElementById("tabpage_body")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_div) & @CRLF)
$1_frame = $oIE.document.getElementById("AID_1460110786614_iframe")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_frame) & @CRLF)
$1_input = $oIE.document.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($1_input) = " & IsObj($1_input) & @CRLF)

ConsoleWrite("------------ #### ------------" & @CRLF)

$2_frame = $oIE.document.getElementById("AID_1460110786614_iframe")
ConsoleWrite("IsObj($2_frame) = " & IsObj($2_frame) & @CRLF)
$2_frame_doc = $2_frame.contentWindow.document
ConsoleWrite("IsObj($2_frame_doc) = " & IsObj($2_frame_doc) & @CRLF)
$2_input = $2_frame_doc.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($2_input) = " & IsObj($2_input) & @CRLF)



>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3
+>19:41:04 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
IsObj($oIE) = 1
IsObj($1_div) = 1
IsObj($1_div) = 1
IsObj($1_input) = 0
------------ #### ------------
IsObj($2_frame) = 1
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (23) : ==> The requested action with this object has failed.:
$2_frame_doc = $2_frame.contentWindow.document
$2_frame_doc = $2_frame.contentWindow^ ERROR
->19:41:05 AutoIt3.exe ended.rc:1
+>19:41:05 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 2.321

I have tried with the second way too, but the output is very big. I cannot post the output because browser crashes.

The ID is the same and okay, and there is no other internet explorer instance
Because I can see that: tabpage_body ok > AID_1460110786614_iframe ok > serviceNo_input_value not ok
And yes, I'm trying to put some value into that input box after I can get the object. Because if I can get the object from this frame, I can also get other objects in the same frame too; can set the value or reading the value will be okay

Edited by taylansan
My post didn't go, so I write again

TY.

Share this post


Link to post
Share on other sites
markyrocks
1 minute ago, MichaelHB said:

@markyrocks i belive he is trying to set input value/text in a form, not trying to read it. :)

Ya no doubt but at this point he's not able to get the object.   I'm was trying to get back to basics here.  If the object doesn't show up in the example I posted I doubt would even be possible to get the object.  If it was an input he should be using _ieformgetobjbyname()

Share this post


Link to post
Share on other sites
MichaelHB

@taylansan sorry for the late reply. :)

Try this and post the output.

#include <IE.au3>

$Value = "" ; put the value between the "" you want to set. Be sure its the value of the input you want to change
            ; and its a correct type, some forms validate the value.

$oIE = _IEAttach("", "instance", 1)
If Not IsObj($oIE) Then Exit ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)

$Frame = $oIE.document.getElementById("AID_1460110786614_iframe")
ConsoleWrite("IsObj($Frame) = " & IsObj($Frame) & @CRLF)

$Frame_Content = $Frame.contentDocument
ConsoleWrite("IsObj($Frame_Content) = " & IsObj($Frame_Content) & @CRLF)

$Input = $Frame_Content.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($Input) = " & IsObj($Input) & @CRLF)

If IsObj($Input) Then $Input.value = $Value

Exit

 

Share this post


Link to post
Share on other sites
taylansan

@MichaelHB Late reply is okay, I'm late too. Actually thank you for the reply. 

This is the output:

$Value = "" ; put the value between the "" you want to set. Be sure its the value of the input you want to change
            ; and its a correct type, some forms validate the value.

$oIE = _IEAttach("", "instance", 1)
If Not IsObj($oIE) Then Exit ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)

$Frame = $oIE.document.getElementById("AID_1460354248311_iframe") ;<===== Changed this only because it always changes
ConsoleWrite("IsObj($Frame) = " & IsObj($Frame) & @CRLF)

$Frame_Content = $Frame.contentDocument
ConsoleWrite("IsObj($Frame_Content) = " & IsObj($Frame_Content) & @CRLF)

$Input = $Frame_Content.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($Input) = " & IsObj($Input) & @CRLF)

If IsObj($Input) Then $Input.value = $Value

Exit



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
IsObj($Frame) = 1
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (18) : ==> The requested action with this object has failed.:
$Frame_Content = $Frame.contentDocument
$Frame_Content = $Frame^ ERROR
->11:01:00 AutoIt3.exe ended.rc:1
+>11:01:00 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 0.726

I can get the frame for AID, but I cannot go inside...

I think there is way to read that iframe.


TY.

Share this post


Link to post
Share on other sites
Juvigy

Ok , so we have progress, there are 2 nested divs with the same ID. SO try this one:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )      
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
            For $oInput2 In $oInputs2
                If $oInput2.id = $oInput.id Then ;to check if it's the correct div2
                    ConsoleWrite("Okay inside that div2: " & $oInput2.id & @CRLF )
                EndIf
            Next    
    EndIf
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

Share this post


Link to post
Share on other sites
taylansan

@Juvigy Here is the output

>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311_title
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311_close
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311_body
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
+>13:54:41 AutoIt3.exe ended.rc:0
+>13:54:41 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.701

There are four "Okay inside div", but cannot see any "div2"

So far I have understood the logic, but I couldn't get the reason why we check 2nd div after finding and inside the 1st div


TY.

Share this post


Link to post
Share on other sites
Juvigy

We want to get to the second DIV which is inside the first one. In the second DIV is the IFRAME.  This is how i see it in the code screenshot.

Try it like this:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )      
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
            For $oInput2 In $oInputs2
                ConsoleWrite("Div2: " & $oInput2.id & @CRLF )
            Next    
    EndIf
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

 

Share this post


Link to post
Share on other sites
taylansan

Here we can get inside the second DIV

$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
        For $oInput2 In $oInputs2
            ConsoleWrite("Div2: " & $oInput2.id & @CRLF )
            ; <==== I have edeted here
            If $oInput2.id = "AID_1460373684268" Then
                ConsoleWrite("It's okay we found this" & @CRLF)
                $Frame = $oInput2.document.getElementById("AID_1460373684268_iframe")
                ConsoleWrite("IsObj($Frame) = " & IsObj($Frame) & @CRLF)
                $o1 = _IEGetObjById($Frame, "serviceNo_input_value")
                $o2 = _IEGetObjByName($Frame, "searchCond.serviceNo")
                $o3 = _IEFrameGetObjByName($Frame, "searchCond.serviceNo")
                $o4 = _IEFormGetObjByName($Frame, "searchCond.serviceNo")
                $o5 = _IEFormElementGetObjByName($Frame, "searchCond.serviceNo")
            EndIf
            ; <==== Until here
        Next
    EndIf
Next



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Okay inside that div: AID_1460373684268_title
Okay inside that div: AID_1460373684268_close
Okay inside that div: AID_1460373684268_body
Div2: AID_1460373684268
It's okay we found this
IsObj($Frame) = 1
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (serviceNo_input_value)
--> IE.au3 T3.0-2 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: searchCond.serviceNo, Index: 0)
--> IE.au3 T3.0-2 Warning from function _IEFrameGetObjByName, $_IESTATUS_NoMatch (No frames matching name)
--> IE.au3 T3.0-2 Warning from function _IEFormGetObjByName, $_IESTATUS_NoMatch
--> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType
Okay inside that div: AID_1460373684268
+>16:23:55 AutoIt3.exe ended.rc:0
+>16:23:55 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.546

I have made a few other tries without modifying your suggestion - I didn't know if it would be successful, so I have tried all the 5 ways to get an object, but all failed

Also thank you for explaining the logic for going inside these two DIVs :)


TY.

Share this post


Link to post
Share on other sites
Juvigy

Now that you have the second DIV , use it to get the iframe inside :

$oFrames = _IEFrameGetCollection ($div2)
$iNumFrames = @extended
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($div2, $i)
    ;check here for the correct iframe
Next
Edited by Juvigy
spell check

Share this post


Link to post
Share on other sites
taylansan

The frame didn't come (I assumed to use $oInput2, am I correct?)

$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
        For $oInput2 In $oInputs2
            ConsoleWrite("Div2: " & $oInput2.id & @CRLF )
            $oFrames = _IEFrameGetCollection($oInput2)
            $iNumFrames = @extended
            ConsoleWrite("Number of frames: " & $iNumFrames & @CRLF)
            For $i = 0 to ($iNumFrames - 1)
                $oFrame = _IEFrameGetCollection($oInput2, $i)
                ;check here for the correct iframe
                ConsoleWrite("Now i: " & $i & " Name: " & $oFrame.name & " ID: " & $oFrame.id & @CRLF)
            Next
        Next
    EndIf
Next



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"

Even if inside the DIV, I'm unable to get that frame ID or name. But in the above screenshot, I'm able to that the frame name / ID actually exists


TY.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • rm4453
      By rm4453
      I have a table I am parsing, to find specific vehicle information. I am unable to get _ArrayFindAll to return the only valid result with my test data.
      Below is a sample of the table's HTML:
      <td class="textCenter">2010</td> <td>TOYOTA</td> <td>TACOMA 4X4 DB</td> <td></td> <td>BLACK</td> <td class="textCenter">C</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">80,975</td> <td class="textRight" nowrap="nowrap">$16,800</td> </tr> <tr><!-- 308 --> <td class="textCenter">2010</td> <td>TOYOTA</td> <td>TACOMA 4X4 RG</td> <td></td> <td>BLACK</td> <td class="textCenter">R</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">5</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">95,224</td> <td class="textRight" nowrap="nowrap">$9,500</td> </tr> <tr><!-- 309 --> <td class="textCenter">2011</td> <td>BUICK</td> <td>REGAL</td> <td>CXL RL4</td> <td>BLACK</td> <td class="textCenter">4</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">102,694</td> <td class="textRight" nowrap="nowrap">$5,000</td> </tr> <tr><!-- 310 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>AVALANCH 4X4 CR</td> <td>LS</td> <td>GRAY</td> <td class="textCenter">C</td> <td class="textCenter">8</td> <td>E</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">64,759</td> <td class="textRight" nowrap="nowrap">$16,300</td> </tr> <tr><!-- 311 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>EQUINOX AWD 4C</td> <td>LT W/2LT</td> <td>BLACK</td> <td class="textCenter">S</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">AWD</td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">91,896</td> <td class="textRight" nowrap="nowrap">$4,400</td> </tr> <tr><!-- 312 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>TAHOE 4X4 V8</td> <td>LTZ</td> <td>WHITE</td> <td class="textCenter">S</td> <td class="textCenter">8</td> <td>C</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>N</td> <td class="textCenter">MR</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">126,982</td> <td class="textRight" nowrap="nowrap">$17,800</td> </tr> <tr><!-- 313 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>1500 SLV 4X4 EX</td> <td>LT</td> <td>GRAY</td> <td class="textCenter">X</td> <td class="textCenter">8</td> <td>GAS</td> <td class="textCenter">O</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">60,303</td> <td class="textRight" nowrap="nowrap">$18,100</td> </tr> <tr><!-- 314 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>1500 SLV 4X4 EX</td> <td>LT</td> <td>SILVER</td> <td class="textCenter">X</td> <td class="textCenter">8</td> <td>E</td> <td class="textCenter">O</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">89,403</td> <td class="textRight" nowrap="nowrap">$15,900</td> </tr> <tr><!-- 315 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>1500 SLV 4X4 EX</td> <td>LTZ</td> <td>BLUE</td> <td class="textCenter">X</td> <td class="textCenter">8</td> <td>E</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">53,087</td> <td class="textRight" nowrap="nowrap">$17,700</td> </tr> <tr><!-- 316 --> <td class="textCenter">2011</td> <td>CHEVROLET</td> <td>3500 CUTAWAY</td> <td>WORK VAN</td> <td>WHITE</td> <td class="textCenter">S</td> <td class="textCenter"></td> <td></td> <td class="textCenter">A</td> <td class="textCenter">4X2</td> <td class="textCenter"></td> <td>N</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">202,477</td> <td class="textRight" nowrap="nowrap">$2,700</td> </tr> <tr><!-- 317 --> <td class="textCenter">2011</td> <td>CHRYSLER</td> <td>TOWN &amp; COUNTRY</td> <td>TOURING</td> <td>BLACK</td> <td class="textCenter">4</td> <td class="textCenter">6</td> <td>E</td> <td class="textCenter">A</td> <td class="textCenter">4X2</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter"></td> <td class="textRight" nowrap="nowrap">198,541</td> <td class="textRight" nowrap="nowrap">$1,900</td> </tr> <tr><!-- 318 --> <td class="textCenter">2011</td> <td>DODGE</td> <td>DURANGO AWD V6</td> <td>CREW</td> <td>BLUE</td> <td class="textCenter">S</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">AWD</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">176,036</td> <td class="textRight" nowrap="nowrap">$2,800</td> </tr> <tr><!-- 319 --> <td class="textCenter">2011</td> <td>FORD</td> <td>FOCUS</td> <td>SE</td> <td>SILVER</td> <td class="textCenter">4</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">101,929</td> <td class="textRight" nowrap="nowrap">$3,100</td> </tr> <tr><!-- 320 --> <td class="textCenter">2011</td> <td>FORD</td> <td>FUSION FWD 4C</td> <td>SEL</td> <td>WHITE</td> <td class="textCenter">4</td> <td class="textCenter">4</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">SR</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">78,290</td> <td class="textRight" nowrap="nowrap">$5,500</td> </tr> <tr><!-- 321 --> <td class="textCenter">2011</td> <td>FORD</td> <td>F150 4X4 CR</td> <td>XLT</td> <td>BLACK</td> <td class="textCenter">C</td> <td class="textCenter">8</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">4X4</td> <td class="textCenter">Y</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">70,909</td> <td class="textRight" nowrap="nowrap">$16,000</td> </tr> <tr><!-- 322 --> <td class="textCenter">2011</td> <td>FORD</td> <td>MUSTANG V6 CPE</td> <td>V6 PREMIUM</td> <td>BLACK</td> <td class="textCenter">2</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter">4X2</td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">L</td> <td class="textRight" nowrap="nowrap">92,531</td> <td class="textRight" nowrap="nowrap">$2,700</td> </tr> <tr><!-- 323 --> <td class="textCenter">2011</td> <td>GMC</td> <td>ACADIA FWD</td> <td>SLE</td> <td>RED</td> <td class="textCenter">4</td> <td class="textCenter">6</td> <td>GAS</td> <td class="textCenter">A</td> <td class="textCenter"></td> <td class="textCenter">A</td> <td>CD</td> <td class="textCenter">HT</td> <td class="textCenter">C</td> <td class="textRight" nowrap="nowrap">79,199</td> <td class="textRight" nowrap="nowrap">$10,700</td> A picture of the table test data is attached here:

      Here is the _query function, and all other relevant code that I can share.
       
      Func _query($aSel, $aUrls) $oIE = _login() If $oIE = "Return" Then Return EndIf $j = 0 While $j < UBound($aSel) - 1 $i = 1 $aucID ;Unable To Share What This Is Other Than Var Name. _IENavigate($oIE, "Something" & $aucID[0] & "Something") _IELoadWait($oIE, 100, 2000) $oObj = _IETableGetCollection($oIE, 3) $cars = _IETableWriteToArray_ProgressBar($oObj, True, "Processing Requested Information!") ;<---- Modified Version See Post For It: https://www.autoitscript.com/forum/topic/195335-solved-how-to-add-a-progress-bar-to-_ietablewritetoarray/?tab=comments#comment-1400699 $carsYear = _filter($cars, 0, 0, GUICtrlRead($year)) $carsMake = _filter($carsYear, 0, 1, GUICtrlRead($make)) Global $carsModel = _filter($carsMake, 0, 2, GUICtrlRead($model)) $i = 0 $engine = GUICtrlRead($engine) If $engine <> "" Then While $i < StringLen($engine) $carsEngine = _filter($carsModel, 0, 6 + $i, StringLeft($engine, 1)) ;_ArrayDisplay($carsModel, "Cars Model Before Array Delete") $x = 1 While $x <= UBound($carsModel) _ArrayDelete($carsModel, $x) $x += 1 WEnd ;_ArrayDisplay($carsModel, "Cars Model After Array Delete") ;_ArrayConcatenate($carsModel, $carsEngine) ;_ArrayDisplay($carsModel, "Cars Model After Concatenate") $engine = StringTrimLeft($engine, 1) $i += 1 WEnd Else Dim $carsEngine[1][16] EndIf _ArrayConcatenate($carsEngine, $carsModel) _ArrayDisplay($carsEngine, "Cars Engine") Dim $carsDriveTrain[1][16] Dim $carsDriveTrain2[1][16] $driveTrainVal = GUICtrlRead($driveTrain) If $driveTrainVal = "4x4" Or $driveTrainVal = "awd" Then $carsDriveTrain = _filter($carsEngine, 0, 9, "4") $carsDriveTrain2 = _filter($carsEngine, 0, 9, "a") ;~ _ArrayDisplay($carsDriveTrain, "Drive Train Before") ;~ If @error Then ;~ MsgBox("", "", "Cars Drive Train Error: " & @error) ;~ EndIf ;~ _ArrayDisplay($carsDriveTrain2, "Drive Train2 Before") ;~ If @error Then ;~ MsgBox("", "", "Cars Drive Train 2 Error: " & @error) ;~ EndIf _ArrayConcatenate($carsDriveTrain, $carsDriveTrain2) _ArrayDisplay($carsDriveTrain, "Drive Train After Concat") ElseIf $driveTrainVal = "" Then _ArrayConcatenate($carsDriveTrain, $carsEngine) Else $carsDriveTrain = _filter($carsEngine, 0, 9, $driveTrain) EndIf Dim $carsOdom[1][16] $min = GUICtrlRead($odomMin) $max = GUICtrlRead($odomMax) For $i = 0 To UBound($carsDriveTrain) - 1 If $carsDriveTrain[$i][14] > $min And $carsDriveTrain[$i][14] < $max Then _ArrayAdd($carsOdom, $carsDriveTrain[$i]) MsgBox("", "", "ADDED!") EndIf Next _ArrayDisplay($carsOdom, "Cars Odom") $j += 1 WEnd _IEQuit($oIE) EndFunc ;==>_query Func _filter($tofilter, $xpos1, $ypos1, $str) ;~ If UBound($tofilter, 1) <= 1 Then ;~ $endx = 0 ;~ Else ;~ $endx = UBound($tofilter, 1) - 1 ;~ EndIf ;~ $cars = _ArrayFindAll($tofilter, $str, $tofilter[$xpos1][$ypos1], $tofilter[$endx][$ypos1], 0, 1, $ypos1, False) $cars = _ArrayFindAll($tofilter, $str, Default, Default, 0, 1, $ypos1) Dim $carsFiltered[1][16] = [["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"]] ;_ArrayDisplay($carsFiltered) $i = 0 $uBound = UBound($cars) - 1 While $i < $uBound $filtered = _ArrayExtract($tofilter, $cars[$i], $cars[$i], 0, 15) ;_ArrayDisplay($filtered, "_filter Array of Filtered") _ArrayConcatenate($carsFiltered, $filtered) $i += 1 WEnd _ArrayDelete($carsFiltered, 0) Return $carsFiltered EndFunc ;==>_filter  
      If you know of a more efficient way of doing this please let me know would be more than happy to chew down my inefficiency while learning! (It's like my grandpa used to say, "The only criticism I can't use is that which is not given to me.")
       
      The Item an I am using to test the filter is:

       
    • rm4453
      By rm4453
      Hello,
       
      I am currently writing a program that parses a massive table from a website, and need a way to add a progress bar while parsing.
      I am currently using the function _IETableWriteToArray($oObj, True) to parse the array. I need the progress bar to update as the table is parsed, not just at the end of the parsing.
      Any help at all would be very much appreciated!
       
      *EDIT --> The array I am left with after parsing is $array[0-50000][16]
    • SkysLastChance
      By SkysLastChance
      I have a goofy problem. I am hoping someone could shed some light. The example is not going around the text box. It is way off. 
      I have seen some post blaming IE 11, however I have IE11 on my desktop and it works fine.
      Is there anything I can do that might fix this? 
       
      ; Open a browser with the form example and get a reference to the form ; textarea element. Get the coordinates and dimensions of the text area, ; outline its shape with the mouse and come to rest in the center #include <IE.au3> Local $oIE = _IE_Example("form") Local $oForm = _IEFormGetObjByName($oIE, "ExampleForm") Local $oTextArea = _IEFormElementGetObjByName($oForm, "textareaExample") ; Get coordinates and dimensions of the textarea Local $iScreenX = _IEPropertyGet($oTextArea, "screenx") Local $iScreenY = _IEPropertyGet($oTextArea, "screeny") Local $iWidth = _IEPropertyGet($oTextArea, "width") Local $iHeight = _IEPropertyGet($oTextArea, "height") ; Outline the textarea with the mouse, come to rest in the center Local $iMousespeed = 50 MouseMove($iScreenX, $iScreenY, $iMousespeed) MouseMove($iScreenX + $iWidth, $iScreenY, $iMousespeed) MouseMove($iScreenX + $iWidth, $iScreenY + $iHeight, $iMousespeed) MouseMove($iScreenX, $iScreenY + $iHeight, $iMousespeed) MouseMove($iScreenX, $iScreenY, $iMousespeed) MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed)  
       
    • diego_bihalva
      By diego_bihalva
      Hi guys!
       I'm looking for your help  
      The problem is: when I got the iFrame object at the page's source code, the return was "ok", but when I tryed to pick the iFrame's source code, the result is "nothing". Even use the _IETagNameAllGetCollection and others similar functions the result is the same: "nothing"
       
      Au3 Script:
      ... #include<IE.au3> Local $oIE = ... Local $oFrame = _IEGetObjById($oIE, "_wicket_window_3") ConsoleWrite(IsObj($oFrame) & @CRLF) ;RESULT = 1 ConsoleWrite($oFrame.outerHtml & @CRLF) ;RESULT = NOTHING Principal Page's source code:
      Note: the form tag doesn't have a ID or Name, but if I look for iFrame from $oIE source code, It's "ok". <html> ... <body> ... DIVs, INPUTS, and so forth ... <div class="wicket-modal" id="_wicket_window_0" role="dialog" aria-labelledby="Portal da Portabilidade de Crédito" style="left: 283px; top: 273.5px; width: 800px; visibility: visible; position: absolute;"> ... DIVs, INPUTS, and so forth ... <form style="border-width: 0px; margin: 0px; padding: 0px; position: static; background-color: transparent;"> ... DIVs, INPUTS, and so forth ... <iframe class="wicket_modal" id="_wicket_window_3" src="" frameborder="0" style="height: 620px;" allowtransparency="false"></iframe> ... DIVs, INPUTS, and so forth ... </form> ... DIVs, INPUTS, and so forth ... </div> ... DIVs, INPUTS, and so forth ... </body> </html>  
      iFrame's "_wicket_window_3" source code, viewed by IE Element Inspector (I WANNA GET THIS):
      <html xmlns="http://www.w3.org/1999/xhtml"><head><script src="/static/js/jquery-1.8.3.js" type="text/javascript"></script> <script src="../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1408133796000.js" type="text/javascript"></script> <script src="../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-ver-1408133796000.js" type="text/javascript"></script> <script src="../../wicket/resource/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal-ver-1408133800000.js" type="text/javascript"></script> <link href="../../wicket/resource/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal-ver-1408133800000.css" rel="stylesheet" type="text/css"> <script id="wicket-ajax-base-url" type="text/javascript"> /*<![CDATA[*/ Wicket.Ajax.baseUrl="ctc/portabilidadeContaSalario/detalhar?3"; /*]]>*/ </script> <script src="../../../../static/js/jquery-ui/jquery-ui.min.js" type="text/javascript"></script> <link href="../../../../static/js/jquery-ui/jquery-ui.min.css" rel="stylesheet" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="robots" content="noindex"> <link href="../../static/css/ctc.css" rel="stylesheet" type="text/css"> <link href="../../static/css/ctc_custom.css" rel="stylesheet" type="text/css"> <script src="../../static/js/deployJava.js" charset="utf-8"></script></head><body><object width="0" height="0" id="deployJavaPlugin" classid="clsid:CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA" data="data:application/x-oleobject;base64,rO/+ysfeAAAAAavN7/7cugAKAAAAAAAAAAAAAA=="></object> <script src="../../static/js/jquery-ctc.js" charset="utf-8"></script> <script src="../../static/js/signUtils.js" charset="utf-8"></script> <script src="../../static/js/json3.in.js" charset="utf-8"></script> <script src="../../static/js/menu2.js" charset="utf-8"></script> <script src="../../static/js/componentTicket.js" charset="utf-8"></script> <script src="../../static/js/appletScript.js" charset="utf-8"></script> <script src="../../static/js/biginteger/bigInteger.js" charset="utf-8"></script> <link href="../../favicon.ico" rel="icon" type="image/ico"> <script id="jquery.blockui" src="../../static/js/jquery.blockUI.js" type="text/javascript" charset="utf-8"></script> <script id="jquery.maskedinput" src="../../static/js/jquery.maskedinput-1.3.1.min.js" type="text/javascript" charset="utf-8"></script> <script id="jquery.priceformat" src="../../static/js/jquery.price_format.2.0.js" type="text/javascript" charset="utf-8"></script> <script src="/csrfTokenS" type="text/javascript"></script> <script type="text/javascript"> /*<![CDATA[*/ Wicket.Event.add(window, "domready", function(event) { Wicket.Ajax.ajax({"sc":"content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divTitle:btnRecolheAbba","c":"btnRecolheAbba4e","u":"./detalhar?3-1.IBehaviorListener.0-rootContent-BaseMainContent-BaseBlocoDireito-layoutForm-content-contentChild-contentForm-RightContent-ContentDiv-wizardPortabilidade-divTab-tabsWizard-0-tabWizard-divTabContent-divContent-tabContent-dataForm-divTitle-btnRecolheAbba","e":"click","f":"dataForm4d","m":"POST"});; $(document).ready(function(){if(isChrome()) { $('#contentChild').css({ 'border-top':'solid 1px white'});}window.scrollTo(0,0);; $("#cpfCli4f").mask("999.999.999-99",{}); $("#cpfCli4f").mask("999.999.999-99",{}); $("#TelCli50").mask("(99)99999999?9",{});}); Wicket.Ajax.ajax({"sc":"content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:containnerButtons:containerAcionsButtons:1:actionButton","c":"actionButton51","u":"./detalhar?3-1.IBehaviorListener.0-rootContent-BaseMainContent-BaseBlocoDireito-layoutForm-content-contentChild-contentForm-RightContent-ContentDiv-wizardPortabilidade-divTab-tabsWizard-0-tabWizard-divTabContent-divContent-tabContent-dataForm-containnerButtons-containerAcionsButtons-1-actionButton","e":"click","f":"dataForm4d","m":"POST"});; Wicket.Ajax.ajax({"c":"dataForm4d","u":"./detalhar?3-1.IBehaviorListener.0-rootContent-BaseMainContent-BaseBlocoDireito-layoutForm-content-contentChild-contentForm-RightContent-ContentDiv-wizardPortabilidade-divTab-tabsWizard-0-tabWizard-divTabContent-divContent-tabContent-dataForm","e":"submit","f":"dataForm4d","m":"POST"});; Wicket.Ajax.ajax({"c":"contentForm52","u":"./detalhar?3-1.IBehaviorListener.0-rootContent-BaseMainContent-BaseBlocoDireito-layoutForm-content-contentChild-contentForm","e":"submit","f":"contentForm52","m":"POST"});; Wicket.Ajax.ajax({"c":"layoutForm","u":"./detalhar?3-1.IBehaviorListener.0-rootContent-BaseMainContent-BaseBlocoDireito-layoutForm","e":"submit","f":"layoutForm","m":"POST"});; ;}); /*]]>*/ </script> <title>Portal da Portabilidade de Crédito</title> <div id="rootContent"> <div id="main" style="margin: 0px;"> <div id="corpo"> <div id="blocoDireito" style="padding: 0px; top: 0px;"> <form id="layoutForm" action="./detalhar?3-1.IFormSubmitListener-rootContent-BaseMainContent-BaseBlocoDireito-layoutForm&amp;SECURITYTOKEN=HIMY-BPSD-5C7F-20H2-XERE-E38O-YKYZ-VVB7-H53V-M9FA-B4CB-P3E6-557U-T5J7-IB1Q-N256" method="post" defaultform="true"><div style="left: -100px; top: -100px; width: 0px; height: 0px; overflow: hidden; position: absolute;"><input name="layoutForm_hf_0" id="layoutForm_hf_0" type="hidden"></div> <div id="messagePanel" style="display: none;"></div> <div id="pagina"> <div id="contentChild"> <div id="contentForm52" defaultform="true"> <div id="right" style="margin: 0px;"> <div id="conteudo" style="margin: 0px;"> <span><h3 style="margin: 0px 0px 10px; padding: 0px;"> <font color="gray">NU Portabilidade: </font>201807110000056998252 <br><font color="gray">Situação: </font>Aceite Compulsório por falta de resposta do Participante Folha de Pagamento <br><font color="gray">Data: </font>17/07/2018 <br><font color="gray">Motivo: </font>Aceite Compulsório por falta de resposta do Participante Folha de Pagamento</h3></span> <span> <div class="passos" id="divBreadCrumb53"> <div class="passo ativo"> <div class="passo numero ativo"><span>1</span></div> <div class="passoTexto"><span>Cliente</span></div> <br class="clr"> <div class="passoStatus"><span>Você está aqui</span></div> </div> <div class="passo inativo"> <div class="passo numero inativo"><span>2</span></div> <div class="passoTexto"><span>Participante</span></div> <br class="clr"> <div class="passoStatus"><span>Você está aqui</span></div> </div> </div> <div id="divTab54"> <div class="passosConteudo"> <div> <div id="AbaCliente_0" ticket="Identificação do cliente" containnerpath="AbaCliente_0" containnerid="AbaCliente_0"> <div id="dataForm4d" defaultform="true"> <table style="width: 726px;" border="0" cellspacing="0" cellpadding="0"> <tbody><tr> <td class="destaqueTb" style="width: 100%;"> <span class="tituloTb">Identificação do cliente</span> <span class="imgTb"><input name="content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divTitle:btnRecolheAbba" class="btRecolher" id="btnRecolheAbba4e" type="button"></span> </td> </tr> <tr> <td class="blocoDados2 itemVisivel" id="divContent_tabContent"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody><tr> <td> <div class="dados"> <span>CPF *</span><br> <input name="content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divContent:cpfCli" disabled="disabled" id="cpfCli4f" style="width: 210px;" maxlength="15" value="01234567890" ticket="CPF" mask="CPF" unmask="true" ticketpath="AbaCliente_0"> </div> </td> </tr> <tr> <td colspan="2"> <div class="dados"> <span>Nome *</span><br> <input name="content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divContent:NomCli" disabled="disabled" id="NomCli55" style="width: 550px;" type="text" maxlength="80" value="JOAO DA SILVA" ticket="Nome" ticketpath="AbaCliente_0"> </div> </td> </tr> <tr> <td> <div class="dados"> <span>Telefone</span><br> <input name="content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divContent:TelCli" disabled="disabled" id="TelCli50" style="width: 210px;" type="text" value="" ticket="Telefone" mask="TELEFONE_DDD_XSD" unmask="false" ticketpath="AbaCliente_0"> </div> </td> <td> <div class="dados"> <span>Email</span><br> <input name="content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divContent:EmailCli" disabled="disabled" id="EmailCli56" style="width: 300px;" type="text" maxlength="50" value="" ticket="Email" ticketpath="AbaCliente_0"> </div> </td> </tr> <tr> <td> <div class="dados"> <span>Código Autenticação do Beneficiário</span><br> <input name="content:contentChild:contentForm:RightContent:ContentDiv:wizardPortabilidade:divTab:tabsWizard:0:tabWizard:divTabContent:divContent:tabContent:dataForm:divContent:codigoAutenticacaoBeneficiario" disabled="disabled" id="codigoAutenticacaoBeneficiario57" style="width: 210px;" type="text" maxlength="100" value="" ticket="Código Autenticação do Beneficiário" ticketpath="AbaCliente_0"> </div> </td> </tr> </tbody></table> </td> </tr> </tbody></table> <div class="botoes"> <input name="ACTION" class="botao botaoPadrao" id="actionButton51" type="submit" value="Próximo"> </div> </div> </div> </div> </div> </div> <div class="botoes" id="divBotoes58" style="margin: -30px 0px 4px;"> </div> </span> <span></span> </div> </div> </div> </div> <div id="popUpWindow59" style="display: none;"> <div id="content5a" style="display: none;"></div> </div> <div id="popupConfirmacao5b" style="display: none;"> <div id="content5c" style="display: none;"></div> </div> </div> <input name="SECURITYTOKEN" type="hidden" value="XXXX"></form> <br class="clr"> </div> </div> </div> <script type="text/javascript"> /*<![CDATA[*/ $(document).ready(function() { setInterval(function() { var data = new Date(); var options = { year: "numeric", month: "numeric", day: "numeric" }; $('#dataHora').html(data.toLocaleTimeString("pt-BR", options)); }, 1000); }); /*]]>*/ </script> </div> <div style="display: none;"> <h1 id="blockUIView"><img width="40" height="40" style="top: 15px; position: relative;" src="../../static/imagens/big-roller.gif"><span id="messageWait">Por favor, aguarde...</span></h1> </div> <span id="confirmationDialog5d" style="display: none;"> </span> <script>var attributes = {"id":"ecpfApplet","codebase":"*","height":"1","width":"1","code":"br.org.cip.applet.EcpfApplet"}; var parameters = {"jnlp_href":"/jnlp/generator/ecpf.jnlp"}; var version = "1.6"; var applet = deployJava.runApplet(attributes,parameters,version);</script><applet width="1" height="1" id="ecpfApplet" codebase="*" code="br.org.cip.applet.EcpfApplet"><PARAM NAME="_cx" VALUE="26"><PARAM NAME="_cy" VALUE="26"> <param name="jnlp_href" value="/jnlp/generator/ecpf.jnlp"><param name="codebase_lookup" value="false"> </applet> <span id="asynchronousComponent5e" style="display: none;">Asynchronous</span> <script type="text/javascript"> /*<![CDATA[*/ /*** $(document).ready(function() { alert('Completou a renderização'); }); $("#tableRender").ready(function() { alert("Table rendered finish"); }); ****/ $.blockUI.defaults.message = $('#blockUIView'); var assyncProcess = false; $(document).ajaxStart(function() { if(!assyncProcess) $.blockUI(); }).ajaxStop(function() { if(!assyncProcess) $.unblockUI(); }); var fieldNamesError = new Array(); var fieldNamesNoError = new Array(); function fieldsDecorator(fieldError,fieldNoError) { fieldNamesError = fieldError==null?fieldNamesError:fieldError; fieldNamesNoError = fieldNoError==null?fieldNamesNoError:fieldNoError; } function decorator() { $.each(fieldNamesError, function( key, val ) { var selectorID = val;//"[ticket='"+val+"']"; $(selectorID).addClass("inputError"); }); $.each(fieldNamesNoError, function( key, val ) { var selectorID = val;//"[ticket='"+val+"']"; $(selectorID).removeClass("inputError"); }); } function isInternetExplorer() { var ie = navigator.userAgent.toString().toLowerCase().indexOf('msie')>0; return ie; } function isChrome() { var chrome = navigator.userAgent.toString().toLowerCase().indexOf('chrome')>0; return chrome; } function assynchronousProcessing(imageurl,message) { assyncProcess = true; $.unblockUI(); $.blockUI({ message: '<h1><img height="40" width="40" style="position:relative; top:15px;" src="'+imageurl+'" /> '+message+'...</h1>' }); } /*]]>*/ </script> </body></html> Well, I'll appreciate all kind of help.
      Thank you!
    • SkysLastChance
      By SkysLastChance
      So I have two things I am trying to click.
      Policy which works.
      $oInputs3 = _IETagNameGetCollection($oIE, "div") For $oInput3 in $oInputs3 If StringStripWS($oInput3.innertext,1) = "Policy" Then $target = $oInput3 _IELoadWait($target,"",70000) ExitLoop EndIf Next _IEAction($target, "click")  

      And Add Insurance which I havent been able to get to work. 
      $oInputs2 = _IETagNameGetCollection($oIE, "div") For $oInput2 in $oInputs2 If StringStripWS($oInput2.innertext,1) = "Add Insurance" Then $target = $oInput2 _IELoadWait($target,"",70000) ExitLoop EndIf Next _IEAction($target, "click")

      Any Ideas on what I am doing wrong?  I feel like it might be the spaces between >  Add Insurance  < but I am not sure. 
×