次のコードを使用してサイトにログインしようとしています
my $mech = WWW::Mechanize->new(autosave=>1);
$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
$mech->follow_link( text => 'Sign In');
$mech->click();
$mech->field(UserName => "$username");
$mech->field(Password => "$password");
$mech->submit();
しかし、follow_link の間、href には 2 つのフロント スラッシュが含まれます (例: ( //test/sso-login
))。したがって、follow_link はそれを URL 全体と見なし、以下のように失敗します。
Error GETing http://test/sso-login: Can't connect to test:80 (Bad hostname)
href は私が管理しているため、変更できません。この問題を克服し、この href を追加した完全な URL を取得する方法はありますか?