[Wtr-general] How to access a dynamic value from the source code.

Zeljko Filipin zeljko.filipin at gmail.com
Mon Oct 16 08:40:52 EDT 2006


Get url of page with ie.url.

irb(main):003:0> url = ie.url
=> "http://domain.com/sometext&PRO_ID=<12345>&someothertext"2345>&someothertext'


Get product id

irb(main):005:0> pro_id = /PRO_ID=<.*>/.match(url)
=> #<MatchData:0x2e3c108>
irb(main):006:0> pro_id[0]
=> "PRO_ID=<12345>"

For more information, see documentation for Ruby classes MatchData and
Regexp.

Zeljko
-- 
http://zeljkofilipin.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061016/7590f4a5/attachment.html 


More information about the Wtr-general mailing list