Sign in to follow this  
Followers 0
qaravi

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

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
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

Share this post


Link to post
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)

Share this post


Link to post
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"?

Share this post


Link to post
Share on other sites

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"?

By element are you referring to text?

Share this post


Link to post
Share on other sites

By element are you referring to text?

exactly

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  
Followers 0