lillo78

Error trying to access a table from a website

7 posts in this topic

Hi, 

i am trying to access to this site and get the values from it's first table. Here is my code:

Local $oIE = _IECreate($sWeb)

Local $oTable = _IETableGetCollection($oIE, 0)
If @error Then MsgBox(0, "", "Error " & @error)
 

So, the error i'm getting is number 7  ($_IEStatus_NoMatch) - No Match  and i have no clue what's going wrong.  Any idea why Autoit is not getting the table?

Thank you in advance!

Share this post


Link to post
Share on other sites



Well, i think it's because i'm trying to access a table withing a frame directly with  _IETableGetCollectio. I guess i should get the frames first and then get to the table.

I'll try it and see what happens.

Share this post


Link to post
Share on other sites

Looks like the site uses a frame. You will need to get a reference to the frame and then use that object in your _IETableGetCollection instead of $oIE.

Share this post


Link to post
Share on other sites

Yup. Thnx @Danp2 

I'll try it and keep you updated.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

yup, it works perfectly now. Here's the code:

Local $oFrames = _IEFrameGetCollection($oIE)

Local $iNumFrames = @extended

If @error Then MsgBox(0, "", "Error " & @error)
For $i = 0 To ($iNumFrames - 1)
        $oFrame = _IEFrameGetCollection($oIE, $i)
Next
Local $oTable = _IETableGetCollection($oFrame, 0)
Local $aTableData = _IETableWriteToArray($oTable, True)

Thank you!

Edited by lillo78

Share this post


Link to post
Share on other sites

Your For..Next loop isn't doing anything in this case and can be replaced with

$oFrame = _IEFrameGetCollection($oIE, 0)

;-)

Share this post


Link to post
Share on other sites

Very true. Thnx!

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