IE_ExtractTagbyAttrib - how does this work?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

IE_ExtractTagbyAttrib - how does this work?

Post by djs » Mon Apr 30, 2012 5:41 pm

I'm trying to capture a price on a webpage, which has many similar lines of code, and the only way I see to do this is by the font tag. I thought I might be able to use the IE_ExtractTagbyAttrib function, but I couldn't find any samples of how this worked to see if it would even work in this case.

So, I have a TD that looks like this:

Code: Select all

<td><font>$439.80</font></td>

It is not consistently the same TD cell, so I can't just count them. The id is unique to this field, but I can't find a way to capture the field based on a font tag id. To make it slightly harder, the price_lbl27194 will change, based on the configuration of the product. Basically, the number rolls to match the configuration id, and its appended to all of the form fields to keep it straight. I can reliably capture the number, and then concat it to the label, but I need a variable in the extract tag.

Any ideas on how to capture this correctly?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 02, 2012 7:05 am

None of the tags in that snippet of html have any attributes. So ExtractTagByAttrib is not going to help you.

ExtractTagByAttrib allows you to specify a tag type and an attribute type and value.

But neither your TD or FONT tag have any attributes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

Post by djs » Wed May 02, 2012 7:16 am

Well, you are correct, somehow, it got deleted in the code function, I think (I'm sure I pasted it in)....

The line should be something more like:
$439.80

Hopefully that will make more sense....

Thanks
Dan

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 02, 2012 7:19 am

Gone again. Try pasting it and using the CODE button to insert tags around it as if it were script code.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

Post by djs » Wed May 02, 2012 7:24 am

Okay, it was there when I previewed....

Code: Select all

<td><font>$439.80</font></td>
I'm not sure the code tags prevent it from disappearing. Just in case, the open font tag should be:
font id=price_lbl27194
With the normal brackets around it.

Hopefully that works.

Dan

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 02, 2012 7:27 am

Ok, so the attribute is ID and the value of the attribute is price_lbl27194

So you would use something like:

Code: Select all

Let>buffer_SIZE=20
IE_ExtractTagByAttrib>%IE[0]%,{""},{"FONT"},{"ID"},{"price_lbl27194"},1,buffer,ie_res
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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