Jump to content

Question _IETableGetCollection _IETagnameGetCollection


Recommended Posts

I'm trying to pull the class from a table. I have no problem pulling the href but the class is giving me errors.

Here is what i'm trying to do.

$oForm = _IETableGetCollection ($oIE, 3)
$oLinks = _IETagnameGetCollection($oForm, "TR") 
For $oLink in $oLinks   
ConsoleWrite($oLink.class & @CRLF)
Next

So it appears i can't call for .class like i am. Does anyone have any suggestions?

This seems to work just fine though

$oForm = _IETableGetCollection ($oIE, 3)
$oLinks = _IETagnameGetCollection($oForm, "a")
For $oLink in $oLinks
ConsoleWrite($oLink.href & @CRLF)  
Next

An example of one of the cells in the table--

<tr align="left" class="color"><td><a href="http://autoitscript.com">Good friendly People</a></td>

So what i'm looking for is how to pull out the "color" and add it to the table i'm creating in the next step. I'd really like to just look within the table and not the entire sheet.

Thanks!

I suck at programming... But I try really hard! :imwithstupid:

Link to comment
Share on other sites

I dont really know if this will help because I havent found a page to test it

but since noone else answered try this:

#include <IE.au3>
$Url = "http://www.google.com"
Local $oIE = _IECreate($Url, 0, 1)
Local $oTags = _IETagNameGetCollection($oIE, "tr")
For $oTag In $oTags
    MsgBox(0, "Tag", StringRegExpReplace (_IEPropertyGet( $oTag, "outerhtml"))
    MsgBox(0, "Tag class", " & StringRegExpReplace (_IEPropertyGet( $oTag, "outerhtml"), '.*?class="(.*?)".*)', "1"))
Next
Edited by hawkair
Link to comment
Share on other sites

I will give it a try thanks for the advise.

Edit: Didn't work but the IEPropertyGet gives me a good starting point. I will beable to figure out how to do what i want from this. Thanks.

Edited by Yokes9

I suck at programming... But I try really hard! :imwithstupid:

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

×
×
  • Create New...