Jacob_Kold has asked for the wisdom of the Perl Monks concerning the following question:
And some html containing the line: "Object reference not set to an instance of an object" When I try to scrape the same webpage with UserAgent?my $mech = WWW::Mechanize->new(); $mech->get( https://www.aabenraa.dk/politik-og-dialog/politiske-udvalg +/arbejdsmarkedsudvalget/medlemmer ); my $html_udv = $mech->content;
What can I do to get the HTML of the webpage and not get any errors?my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 },); my $res = $ua->get('https://www.aabenraa.dk/politik-og-dialog/politisk +e-udvalg/arbejdsmarkedsudvalget/medlemmer'); my $html = $res->content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error when calling $mechanize->content;
by marto (Cardinal) on Apr 18, 2018 at 14:15 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |