1224 0 Posted November 5, 2010 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
Juvigy 49 Posted November 5, 2010 $oTable = _IEGetObjById($oIE, "tbl") If IsObj($oTable) = 0 then $aData = _IETableWriteToArray($oTable, True) Share this post Link to post Share on other sites
DOTCOMmunications 0 Posted November 5, 2010 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