misjdd Posted October 20, 2008 Posted October 20, 2008 OK, one more question then I will be done (i hope!) Here is the structure for what I want to click (not in a frame or anything) <html> <body> <div id = mainframe> <div> <table> <tbody> <tr> <td> For some reason when I try to drill down to the table, I am getting the collection of 33 tables on the page, not just the one i want. $framesrc = _IEGetObjById($oie, "mainFrame") $headerdiv = _IETagnameGetCollection( $framesrc , "div", 0) $table = _IETableGetCollection($headerdiv,0) $oInputs = _IETagNameGetCollection($table,"td") For $oInput In $oInputs $test = _iepropertyget($oInput, "innerhtml") if $test = "RESFRESH" then $refresh = $oInput Next _ieaction($refresh, "click") thoughts? $cnt = @extended msgbox(0,0,$cnt)
PsaltyDS Posted October 20, 2008 Posted October 20, 2008 OK, one more question then I will be done (i hope!)Here is the structure for what I want to click (not in a frame or anything)<html><body><div id = mainframe><div><table><tbody><tr><td>For some reason when I try to drill down to the table, I am getting the collection of 33 tables on the page, not just the one i want.$framesrc = _IEGetObjById($oie, "mainFrame")$headerdiv = _IETagnameGetCollection( $framesrc , "div", 0)$table = _IETableGetCollection($headerdiv,0)$oInputs = _IETagNameGetCollection($table,"td")For $oInput In $oInputs $test = _iepropertyget($oInput, "innerhtml") if $test = "RESFRESH" then $refresh = $oInputNext_ieaction($refresh, "click")thoughts?$cnt = @extendedmsgbox(0,0,$cnt)1. You should be getting the frame reference with $oFrame = _IEFrameGetObjByName($oIE, "mainFrame").2. $cnt may only be valid if you save it from @extended immediately after getting the collection, and not after performing other functions.3. How do you know you are getting multiple tables? That is very unlikely with the index '0' provided. At the point you show $cnt being displayed, it is more likely the count of "td" tags in $oInputs, or something returned from _IEPropertyGet(), not the count of tables. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
misjdd Posted October 21, 2008 Author Posted October 21, 2008 1. You should be getting the frame reference with $oFrame = _IEFrameGetObjByName($oIE, "mainFrame").2. $cnt may only be valid if you save it from @extended immediately after getting the collection, and not after performing other functions.3. How do you know you are getting multiple tables? That is very unlikely with the index '0' provided. At the point you show $cnt being displayed, it is more likely the count of "td" tags in $oInputs, or something returned from _IEPropertyGet(), not the count of tables. I think i found the issue, and maybe it is a bug with ie.au3? I wrote some code to print each item of the table. Here is what is happening. It starts out ok, but there is a Table nested inside of the table BEFORE the TD element I want to read. The script reads the beginning of the outer table, reads the nested table, and then loses its ability to continue reading tag elements from the outer table... However, when I go up a layer and read the Tag items from the mainframe, it sees it ok. There is something not right with the table being drilled down like that...
misjdd Posted October 21, 2008 Author Posted October 21, 2008 I think i found the issue, and maybe it is a bug with ie.au3? I wrote some code to print each item of the table. Here is what is happening. It starts out ok, but there is a Table nested inside of the table BEFORE the TD element I want to read. The script reads the beginning of the outer table, reads the nested table, and then loses its ability to continue reading tag elements from the outer table... However, when I go up a layer and read the Tag items from the mainframe, it sees it ok. There is something not right with the table being drilled down like that...OK, there is definately something wrong with the code here. I use the following:$mf = _IEGetObjById($oie,"mainFrame")$items = _IETagNameGetCollection($mf,"div")for $item in $items$test = _IEPropertyGet($item,"outertext")if $test = 'REFRESH' Then $refe = $item _ieaction($refe, "click") ConsoleWrite(_IEPropertyGet($item,"outerhtml")& "clicked" &@crlf) ExitLoopEndIfIt Finds the REFRESH button, but when $refe is assigned, it gets assigned another page element instead of the element containing REFRESH. It is assigning an element from a different table.
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