[Wtr-general] How to access a dynamic value from the source
Charley Baker
forum-watir-users at openqa.org
Mon Oct 16 11:33:43 EDT 2006
Try this:
irb(main):021:0> pro_id_url = ie.link(:url, /fuseaction=photos/)
irb(main):021:0> pro_id_url = pro_id_url .to_s
=> "type: link\nid: \nname: \nvalue: \ndisabled: false\nhref: http://domain.com/owners/index.cfm?fuseaction=photos&pro_id=21815\ninner text: Edit French language ad\nimg src: http://domain.com/vd/i/flag_FR.gif"
#### Changed this line to search for numbers, changed to parens
irb(main):021:0> pro_id = /pro_id=(\d+)/.match(pro_id_url)
=> 21815
irb(main):022:0> puts pro_id
21815
=> nil
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4800&messageID=13280#13280
More information about the Wtr-general
mailing list