Jump to content
Sign in to follow this  
Aart01

Select a Table in IE by Class

Recommended Posts

Aart01

I am using a script to select a table from the Ebay results page after searching for a keyword.

I do this by using:

$oTable = _IETableGetCollection ($oIE,13)

As I am using multiple keywords in different category's I am running into the trouble that it is

not always "table nr 13" where the results are displayed by Ebay.

So I am looking for a different way to identify this table.

Is there a way to identify this table through class?

This is the source:

<TABLE class="ebItemlist single" cellSpacing=0 cellPadding=4>

Share this post


Link to post
Share on other sites
junkew

Is there a way to identify this table through class?

This is the source:

<TABLE class="ebItemlist single" cellSpacing=0 cellPadding=4>

Something like below can help you out (read help on _IETagNameGetCollection)

$oElements = _IETagNameGetCollection ($oIE, "TABLE")

;For all objects on HTML page of type TAG

consolewrite("Tag found occurences: " & $oElements.Length & @crLF)

for $i=0 to $oElements.length-1

;For each attribute of an HTML element check if match is there

for $k=0 to $oElements($i).attributes.length-1

$tAttr=$oElements($i).attributes($k).name

$tValue=$oElements($i).attributes($k).value

consolewrite($tAttr & ":" & $tValue & @crLF)

next

next

Share this post


Link to post
Share on other sites
DaleHohm

Perhaps a little more simply:

$oTables = _IETagnameGetCollection($oIE, "table")
$index = 0
For $oTable in $oTables
    ConsoleWrite($index & ": " & $oTable.className & @CR)
    $index += 1
Next

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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
Sign in to follow this  

×