GetCheckBox - what to do if the caption is before the box?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
JamesF
Newbie
Posts: 1
Joined: Wed Sep 08, 2010 3:27 am

GetCheckBox - what to do if the caption is before the box?

Post by JamesF » Wed Sep 08, 2010 3:32 am

I've got a web page that I'm trying to extract data from, with multiple check boxes.

The number of checkboxes depends on the account that I'm looking at; so if I look at the page for account A, there might be the following checkboxes

Aardvarks: check
Baboons: check
Caterpillars: check
Active: check

whereas account B may have
Dogs: check
Elephants: check
Active: check

I have two problems: it seems as though GetCheckBox looks for the checkbox before the caption - how do I handle the case where the caption is before the checkbox?

I thought of using IE_ExtractTag, but since the index of the checkbox will vary with the number of checkboxes, this isn't something that I can write once and assume will work in every situation.

Anyone had similar problems to contend with?

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Sep 08, 2010 1:26 pm

The most robust solution will involve parsing the HTML of the web page directly. You can use either HTTPRequest to get the page source code or use WebRecorder.


Then use string functions or Regular Expressions to "find" what you are looking for.


(I don't believe you can use GetCheckBox for browser applications although I have never tried to do this.)

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts