Help for this page

Select Code to Download


  1. or download this
    <a
    href
    ...
    <a href=http://www.example.com/7>Se<span
    >v&#101;</span>n</a>
    <script>/* --> */</script>
    
  2. or download this
    <script type="text/javascript">/*<![CDATA[
    </script>
    ...
    <![CDATA[
    <a href="http://www.example.com/8">Eight</a>
    ]]>
    
  3. or download this
    use Mojo::DOM;
    my $links = Mojo::DOM->new($html)->find('a[href]');
    ...
        ( my $txt_trim = $link->all_text ) =~ s/^\s+|\s+$//g;
        print $link->{href}, "\t", $txt_trim, "\n";
    }
    
  4. or download this
    use HTML::TreeBuilder::XPath;
    my $p = HTML::TreeBuilder::XPath->new;
    ...
    for my $link (@links) {
        print $link->attr('href'), "\t", $link->as_text_trimmed, "\n";
    }
    
  5. or download this
    use HTML::LinkExtor;
    my $p = HTML::LinkExtor->new;
    ...
        my ($tag, %attrs) = @$link;
        print $attrs{href}, "\n";
    }