Jump to content

Recommended Posts

Posted

I am attempting to write somesimple code that has two purposes. One for learning sake and the other in hopes to pull updated stats from a web page to parse into a report. Following the examples included in the help file I was able to come up with the script below. However, when I run it, I get the message "$_IEStatus_InvalidObjectType". Am I missing an option or is there another step I should throw in to retrieve the data.

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

$oIE = _IECreate  ("<a href='http://www.theanimenetwork.com/Whats-On/Anime-Network-Video-on-Demand/ATT' class='bbc_url' title='External link' rel='external'>http://www.theanimenetwork.com/Whats-On/Anime-Network-Video-on-Demand/ATT</a>")
$oTable  = _IETableGetCollection ($oIE)

$aTableData = _IETableWriteToArray  ($oTable,True)
_ArrayDisplay($aTableData)
<br clear="all">

The array of data does not get displayed. Any suggestions? The URL is one I am using to test with.

Posted

Your $oTable is a collection, not a single table object. To get a particular table by 0-based index, add the index to the parameters:

$oTable = _IETableGetCollection($oIE, 0) ; 0 = first table index

:graduated:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

That got it exactly. Not sure why I was not thinking to use a 0 for the index value (had tried a 1 previously)

To expand on this further, if I wanted to retrieve the table by its ID name ("ID = schedule" in this case), is there an approach I can use? My thought here is that if the page design was ever changed, the table name would likely remain the same where as the table index may change.

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
×
×
  • Create New...