Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert a relative link in Mechanize to an absolute one?

Is there is a way to convert a Mechanize relative-link object to another one which contains the absolute URL.

Mechanize must know the absolute link, because I can call the click method on relative links too.

like image 212
Konstantin Avatar asked Aug 03 '13 21:08

Konstantin


1 Answers

You can just merge the page uri (which is always absolute) with the link uri:

page.uri.merge link.uri
like image 93
pguardiario Avatar answered Nov 01 '22 17:11

pguardiario