Jump to content

can we assign index manually to any webpage object for scripting purpose


qaravi
 Share

Recommended Posts

hi folks,

can we assign programmatically using AutoIt or manually index attribute to a web page object collection

my application is having no. of tables with no index.

how can i identify uniquely each table.

currently i'm going through the following process.

1.getting the table collection

2. taking each table size(rows,columns)

3. searching each table for a given element(hard coding the element data)

4. if any table matching then retrieving that table

now my problem is a given element is found in two tables.

so i'm getting problem

do we have any way to identify table uniquely

thanks in advance

qaravi

Link to comment
Share on other sites

  • Moderators

can we assign programmatically using AutoIt or manually index attribute to a web page object collection

my application is having no. of tables with no index.

Every object in the DOM has an index. If a webpage has multiple tables the first tables in source order is 0 (zero), the next 1, and so on.

how can i identify uniquely each table.

Take a look at the second parameter for _IETableGetCollection().
Link to comment
Share on other sites

Every object in the DOM has an index. If a webpage has multiple tables the first tables in source order is 0 (zero), the next 1, and so on.

Take a look at the second parameter for _IETableGetCollection().

i think index property may depend on how the page(html) code was used.

should i give the second parameter (i.e. table number which i wish to see)?

if that is the case i have to track manually all tables first . is it?

how can i see the index of a DOM object?

here i don't see any index attribute for my table tag/object

Link to comment
Share on other sites

  • Moderators

I'm having some trouble understanding you, but I'll try my best to answer your questions.

The index value is not a visible attribute, but instead how the objects are laid out in source order. To get a reference to the first table in source order you would do the following.

#include <IE.au3>
$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 0)
Link to comment
Share on other sites

I'm having some trouble understanding you, but I'll try my best to answer your questions.

The index value is not a visible attribute, but instead how the objects are laid out in source order. To get a reference to the first table in source order you would do the following.

#include <IE.au3>
$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 0)
i have 10 tables in a web page

there is an element "ravi" in 3 of 10 tables.

how can i get only collection of tables(i.e., 3) that contains "ravi"?

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