Warum hat WWW::Mechanize
leeren Inhalt nach dem Abrufen der folgenden URL? Mit einem Browser oder curl
wird eine vollständige HTML-Seite abgerufen.Warum scheitert WWW :: Mechanize mit "X-Died: Illegaler Feldname 'X-Meta-Twitter: Titel'"?
use WWW::Mechanize;
$mech = new WWW::Mechanize;
$mech->get("http://www.belizejudiciary.org/web/judgements2/");
print $mech->content # prints nothing
Hier wird der Dump der Antwort ist:
HTTP/1.1 200 OK
Connection: close
Date: Fri, 10 Feb 2017 00:51:47 GMT
Server: Apache/2.4
Content-Type: text/html; charset=UTF-8
Client-Aborted: die
Client-Date: Fri, 10 Feb 2017 00:51:48 GMT
Client-Peer: 98.129.229.64:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Link: <http://www.belizejudiciary.org/web/wp-json/>; rel="https://api.w.org/"
Link: <http://www.belizejudiciary.org/web/?p=468>; rel=shortlink
Set-Cookie: X-Mapping-hepadkon=FAB86566672CEB74D66B2818CA030616; path=/
X-Died: Illegal field name 'X-Meta-Twitter:title' at /usr/local/lib/perl5/site_perl/5.16.3/sun4-solaris/HTML/HeadParser.pm line 207.
X-Pingback: http://www.belizejudiciary.org/web/xmlrpc.php
Ich habe Version 3.70 von HTML :: Parser installiert.
Ich bekomme nichts. Welche Version des Moduls verwenden Sie? Was ist der Inhalt von 'use Data :: Dumper; print Dumper ($ mech-> Antwort) '? – choroba
@choroba Mein System hat Version 3.70 von 'HTML: Parser', das könnte ein Problem sein. Siehe meine Bearbeitung für die Antwort. – CJ7
@choroba Hinzufügen von '$ mech-> parse_head (0)' vor dem 'Get' löste das Problem. Von dieser Antwort: http://Stackoverflow.com/a/17745491/327528 – CJ7