my @links = $mech->find_all_links(url_regex => 'asdf.html'); foreach my $link (@links) { print $link->attrs()->{onclick}; }