How do I extract an HTML title with Perl?

前端 未结 7 2051
粉色の甜心
粉色の甜心 2021-01-27 07:55

Is there a way to extract HTML page title using Perl? I know it can be passed as a hidden variable during form submit and then retrieved in Perl that way but I was wondering if

7条回答
  •  感动是毒
    2021-01-27 08:35

    use strict;
    use LWP::Simple;
    
    my $url = 'http://www.google.com'|| die "Specify URL on the cmd line";
    my $html = get ($url);
    $html =~ m{(.*?)}gism;
    
    print "$1\n";
    

提交回复
热议问题