Jump to content

Reading elements present in a table within a table inside a form


Recommended Posts

Hello everyone,

I'm trying to pass values to elements in a website.

The elements are present within a table, which is again present within a table, which is inside a form.

I tried to read the form, tables, etc., but with no results. It appears to me that the elements, tables, form, etc., were not read at all.

The following is what I tried. Please guide me.

;I tried the following to read the tables into arrays

#include <IE.au3>
#include <MsgBoxConstants.au3>

   Local $oIE = _IECreate()
   _IENavigate($oIE, "---- URL HERE ----")
   _IELoadWait($oIE)

   $o_Table = _IETableGetCollection ($oIE)
   $i_NumTables = @extended

   For $i = 0 To $i_NumTables - 1 Step 1
      $o_Table_Temp2 = _IETableGetCollection ($oIE, $i)
      $a_TableData = _IETableWriteToArray ($o_Table_Temp2)
      _ArrayDisplay($a_TableData)
   Next

 

;I tried the following code to pass value to the field

#include <IE.au3>
#include <MsgBoxConstants.au3>

   Local $oIE = _IECreate()
   _IENavigate($oIE, "---- URL HERE ----", 0)
   _IELoadWait($oIE)
   
   Local $oForm = _IEFormGetObjByName($oIE, "default")
   Local $oField = _IEFormElementGetObjByName($oForm, "tGroup")
   _IEFormElementSetValue($oField, "---- VALUE HERE ----")

 

The following is the html view of the website and the highlighted field is the one that I want to pass values to. Since this is an official website, I can't share the exact url.

HTML VIEW.jpg

Edited by Gowrisankar
Link to comment
Share on other sites

16 hours ago, Danp2 said:

Have you tried using _IEGetObjByName to directly retrieve the input element?

@Danp2 Yes.. I tried that too.

Local $oField = _IEGetObjByName($oIE, "tGroup")
_IEFormElementSetValue($oField,"--- VALUE  HERE ---")

I get the following error messages in the console.

--> IE.au3 T3.0-2 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: tGroup, Index: 0)
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType

Edited by Gowrisankar
Link to comment
Share on other sites

first, if you use option 1 on ienavigate you dont need ieloadwait,

second, do an iebodyreadhtml to see if you are even reading the page, if not you may need to do an ieattach

If @error Then
    MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!")
EndIf

"Yeah yeah yeah patience, how long will that take?"  -Ed Gruberman

REAL search results  |  SciTE4AutoIt3 Editor Full Version

Link to comment
Share on other sites

54 minutes ago, alienclone said:

first, if you use option 1 on ienavigate you dont need ieloadwait,

second, do an iebodyreadhtml to see if you are even reading the page, if not you may need to do an ieattach

@alienclone _IEBodyReadHTML($oIE) is reading the page content after using _IEAttach().

But I still couldn't pass values to the fields.

Link to comment
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
 Share

×
×
  • Create New...