MatchData
Sapna asked how to extract id from this link.
The solution includes using MatchData. I use it rarely, and I always forget how it is used. So, every time I need it, I have to read documentation. I have decided to make a note here, so I could easily find it later.
This is how you can get href attribute of that link. I will assumed that he knows text (“RE: Check Copy Request”).
ie.link(:text, “RE: Check Copy Request”).href
=> “MessageDetail.aspx?id=1303&messageToUser=True”
This will extract 1303.
m = /id=(1303)/.match(ie.link(:text, “RE: Check Copy Request”).href)
=> #
m[1]
=> “1303″

Here is another way:
(ie.link(:text, “RE: Check Copy Request”).href =~ /id=(.*)&/)[1]
> “1303″
bret
12 Jun 07 at 7:22 am
Thanks Bret. It is nice to know more than one way to do something.
Željko Filipin
12 Jun 07 at 9:44 am