sub { my($delay, $tx) = @_; my $href = $tx->res->dom->find('a[href]')->[-1]{href}; my $url = $tx->req->url->clone; $href =~ s!/$!!; $href = $href =~ m!^http! ? $href : $href =~ m!^/! ? $url->path($href) : (push(@{$url->path}, $href), $url)[-1]; $ua->get($href, $delay->begin); },