Thank you.  I'm now using this regular expression:

<a .*<\/a><br\/>\s*.*\s+<br\/>\s+<a .*<\/a>\s+<br\/>\s+(.*)\s+<br\/>

This matches the first two links, the text between the first two links, the
text I'm after, and the <br /> tag after it.  One note though: it seems
Watir takes out the forward slashes in the <br /> tags.  My real code uses
"<br> in place of "<br/>".

- Aaron

-----Original Message-----
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com]
On Behalf Of Mark Anderson
Sent: July 29, 2009 6:11 PM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: Getting text between two <br /> tags

Here's how I would do it with a regular expression:

$ie.html =~ /<br\/>\s*(.*)\s*<br\/>\s*Updated/
puts $1

That doesn't pull the tab before 'Text', and assumes that 'Updated' only
appears once in the html.  I don't guarantee that this regexp will work with
any text other than what you provided above, where it returns "Text I want
to extract." in $1 and spits it out to the screen.

Hope this gives you a starting place.
                        /\/\ark




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to