Vlad,
This regular expression:
>
> %r{/switch_accounts.html/}
>
doesn''t match this href:
>
> https://.../reports/switch_accounts.html?...
>
Because the regular expression has a trailing ''/'' after the
accounts.html. I think you could just change to this:
%r{/switch_accounts.html}
and get a match.
Also, something that I do which is useful for me, is to load a copy of
the page in irb, using something like this:
irb> page = Mechanize::Page.new(nil, {''content-type'' =>
''text/html''},
File.read(''my.html''), 200)
(From memory, may have a detail wrong.)
Then, you can test your mechanize code interactively against the page,
and make sure it''s working the way you expect, before you put it in
real code.
Aaron