Jump to content

IE - Accessing a table in HTML


Recommended Posts

I would like to be able to determine if the highlighted part has a value above 0 

image.png.01a56547bafe8cfddb198fb078d7b059.png

To start with I just wanted to return a value using

 

Local $oDiv = _IEGetObjById($oIE, "ctl00_MPH_ctlPaymentsReceivedStatusListing_ctl12_ctlHyperLink")

MsgBox($MB_SYSTEMMODAL, "Line1", $oDiv.value)

I also tried on inner text 

Local $oDiv = _IEGetObjById($oIE, "ctl00_MPH_ctlPaymentsReceivedStatusListing_ctl12_ctlHyperLink")

MsgBox($MB_SYSTEMMODAL, "Line1", $oDiv.value)

However I get a thing telling me that it is not of object type on my console output

(75) : ==> Variable must be of type "Object".:
MsgBox($MB_SYSTEMMODAL, "Line1", $oDiv.value)
MsgBox($MB_SYSTEMMODAL, "Line1", $oDiv^ ERROR
>Exit code: 1    Time: 39.26

 

Link to comment
Share on other sites

28 minutes ago, Danp2 said:

I would use _IETableWriteToArray and then locate the desired value within the array.

Thanks I'll look into that 

 

At the moment I'm not able to return the value correctly though. 

 

Is there a better way to return the value than the below? 

 

Local $oDiv = _IEGetObjById($oIE, "ctl00_MPH_ctlPaymentsReceivedStatusListing_ctl12_ctlHyperLink")

MsgBox($MB_SYSTEMMODAL, "Line1", $oDiv.value)

 

Link to comment
Share on other sites

OK so I tried

Local $oTable = _IETableGetCollection($oIE)
Local $aTableData = _IETableWriteToArray($oTable)
If @error then
   ConsoleWrite(@CRLF & "Error writing to table array")
EndIf



_ArrayDisplay($aTableData)

and got this

 

--> IE.au3 T3.0-2 Error from function _IETableWriteToArray, $_IESTATUS_InvalidObjectType

Error writing to table array>Exit code: 0    Time: 27.1

 

image.png.e18cbfebfdd6495c9198080b379338c0.png

Link to comment
Share on other sites

It will vary depending on the website involved. You could do something like this to figure it out --

_IETableGetCollection($oIE)
$iNumTables = @extended

For $i = 0 To $iNumTables - 1
    $oTable = _IETableGetCollection($oIE, $i)
    $aTableData = _IETableWriteToArray($oTable)
    _ArrayDisplay($aTableData, "Table #" & $i)
Next

Code is untested, so YMMV. 😉

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...