in reply to mech follow_link question

By "relevant", you probably mean "relative".
How is $url set? After following a link, your mech loads the target page. What do you want to get then?