Hi there, I am trying to find a way to find a particular string in an HTML page and save it to a variable.  It seems simple enough, but I can't find the commands to help me do it yet.

Our Dot-Net app assigns Unique ID's to various objects within the system.  For example, if you create a new Customer in an Order-Taking system, the new Customer is assigned a unique ID (let's call it "customerID").  When I look at the HTML page, I see that UID in various places.  For example:
(a) within a "div" tag (within a custom attribute unrecognised by Watir)
(b) within an "a href" link (part of the URL - e.g. "http://www.../../ShowCustomer.aspx?mode=edit&customerID=1234asdf-5678hjlk")

I know that I can use the contains_text() to look for text on the page.  I can also use ie.frame("frameName").html.to_s to capture the contents of the frame.  So how can I tell Watir to find the "customerID=" phrase and then capture the next [fixed-number] set of characters into a string variable?

Thanks in advance.

Paul.

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to