Getting Style attributes from a Table <TD tag

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
glavender
Newbie
Posts: 10
Joined: Thu Aug 21, 2014 7:20 pm

Getting Style attributes from a Table <TD tag

Post by glavender » Thu May 28, 2015 5:30 pm

In the WebRecorder functions there is a function IEExtractTable to get table data. Is there a way to get the Style information about each <TD> cell? I am screen scraping a web page which denotes small sample size data by setting a yellow background on the data as in:

[snippet=]<td style ='width=5.6%; border:1.0pt solid Black; color:black; font-size:9.0pt; font-weight:400; font-family:Arial, sans-serif; text-align:center; vertical-align:middle; background:#FFFF99;'>60&#37;</td>[/snippet]

The one way I see to do this is using IEExtractTag with the Index (hundreds) of the <TD> tag. Is there an easier way to get the Style attributes of the Table TD's?
Thank you,
Gerry

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

Re: Getting Style attributes from a Table <TD tag

Post by Marcus Tettmar » Fri May 29, 2015 11:05 am

You can use IEExtractTag or IEExtractTagByAttrib to get the TDs or the TABLE. Get it to return all HTML and then parse out the style attribute using RegEx.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

glavender
Newbie
Posts: 10
Joined: Thu Aug 21, 2014 7:20 pm

Re: Getting Style attributes from a Table <TD tag

Post by glavender » Fri May 29, 2015 8:41 pm

Thank you Marcus. Seems so obvious now that I look a the command again.
Gerry

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