1224 Posted November 5, 2010 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
Juvigy Posted November 5, 2010 Posted November 5, 2010 $oTable = _IEGetObjById($oIE, "tbl") If IsObj($oTable) = 0 then $aData = _IETableWriteToArray($oTable, True)
DOTCOMmunications Posted November 5, 2010 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
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