Sign in to follow this  
Followers 0
1224

Anyway to check if there is a table in IE?

3 posts in this topic

I want to use the function _IETableWriteToArray

the web content is dynamic

Sometimes may have table, but sometimes may not have

How can I write a script like

If table exist Then <----------------------- how?

_IETableWriteToArray($oTable, True)

......

EndIf

Below is part of my program

In php:

if($xxx){

generate table with id="tbl"

}

i.e. if $xxx is not true, table will not exist

But in Autoit:

_IECreate with the above php

..........

$oTable = _IEGetObjById($oIE, "tbl") ; "tbl" = table id from the web

$aData = _IETableWriteToArray($oTable, True) <------------------this is the main problem

If there is no table in the webpage, an error will be exist

Share this post


Link to post
Share on other sites



$oTable = _IEGetObjById($oIE, "tbl")

If IsObj($oTable) = 0 then $aData = _IETableWriteToArray($oTable, True)

Share this post


Link to post
Share on other sites

Could also use the following to check for a table

$oTable = _IETagNameGetCollection ($oIE, "table")

If it returns as 0 then no tables, also sets @error

Can also get the number of tables from the @extended variable

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
Sign in to follow this  
Followers 0