Jump to content

Error from function _IETableWriteToArray


Jess
 Share

Recommended Posts

Hi,

I am trying to fetch table data from website and display the array. but, it is showing an error  "Error from function _IETableWriteToArray, $_IESTATUS_InvalidDataType".

Please help in the same case.

Thanks 

Link to comment
Share on other sites

Hi,

I am trying to do the same thing with some website, but it is always throwing an error as below.

--> IE.au3 T3.0-2 Warning from function _IETableGetCollection, $_IESTATUS_NoMatch
--> IE.au3 T3.0-2 Error from function _IETableWriteToArray, $_IESTATUS_InvalidDataType

Please can anyone help in this case, as I have tried all the solutions provided above.

Link to comment
Share on other sites

#include <IE.au3>
#include <Array.au3>

_IEErrorHandlerRegister(MyErrFunc)
Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    ; Initialize a COM error handler
; This is my custom defined error handler
Func MyErrFunc()
  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"    & @CRLF  & @CRLF & _
             "err.description is: " & @TAB & $oMyError.description  & @CRLF & _
             "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "       & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
             "err.source is: "       & @TAB & $oMyError.source       & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile     & @CRLF & _
             "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
            )
Endfunc
;_IEErrorNotify(False)

;$iWait = 0
$oIE = _IECreate("https://cmooc.cognizant.com",0,1,0,0)
MsgBox(0,"_IECreate", @error)
Sleep(3000)
$oTable = _IETableGetCollection ($oIE,0)
;MsgBox(0,"Object",IsObj($oTable))
MsgBox(0,"_IETableGetCollection", @error)
$aTableData = _IETableWriteToArray ($oTable)
MsgBox(0,"_IETableWriteToArray", @error)
$iNumTables = @extended


MsgBox(0, "Table Info", "There are " & $iNumTables & " tables on the page")
_ArrayDisplay($aTableData)

Here it is. 

Link to comment
Share on other sites

This code runs fine for me --

#include <IE.au3>
#include <Array.au3>

_IEErrorHandlerRegister(MyErrFunc)
Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    ; Initialize a COM error handler
; This is my custom defined error handler
Func MyErrFunc()
  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"    & @CRLF  & @CRLF & _
             "err.description is: " & @TAB & $oMyError.description  & @CRLF & _
             "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "       & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
             "err.source is: "       & @TAB & $oMyError.source       & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile     & @CRLF & _
             "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
            )
Endfunc
;_IEErrorNotify(False)

;$iWait = 0
$oIE = _IECreate("https://cmooc.cognizant.com")
$oTable = _IETableGetCollection ($oIE,0)
$iNumTables = @extended
$aTableData = _IETableWriteToArray ($oTable)


MsgBox(0, "Table Info", "There are " & $iNumTables & " tables on the page")
_ArrayDisplay($aTableData)

Note the placement of the line that checks @extended. Had to move this so that it captures the value at the proper time.

If you are still having issues, please post the full results from the Scite output window.

Link to comment
Share on other sites

8 hours ago, Jess said:

I have already posted my issue in a new thread.

So why did you post in this thread?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

Merged the posts from the "Other" thread where they didn't belong, Please stick to one thread and no cross posting the same question!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

22 hours ago, Danp2 said:

If you are still having issues, please post the full results from the Scite output window.

@Jess Please do the above. Also, it helps when you can provide details when you respond. Telling us "Is it something with the version or OS that I am working in" doesn't really move the conversation along. What version of AutoIT are you running? What is your OS? Etc.

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...