From: Don Armstrong Date: Wed, 1 Dec 2010 06:03:49 +0000 (+0000) Subject: be mozilla and add cookie jar X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=80f2a9ed154cb4aa2b76b38de31ec6f9cf0f1b97;p=bin.git be mozilla and add cookie jar --- diff --git a/get_pdf b/get_pdf index 74f62dc..e562454 100755 --- a/get_pdf +++ b/get_pdf @@ -108,7 +108,7 @@ if (exists $options{http_proxy}) { } if ($options{pmid}) { - my $m = WWW::Mechanize->new(); + my $m = WWW::Mechanize->new(agent => 'Mozilla',cookie_jar => {}); for my $pmid (@ARGV) { $pmid =~ s/\D//g; next unless length $pmid; @@ -205,6 +205,7 @@ sub find_pdf_link { return $m; } print STDERR "failure; content type ".$r->header('Content-Type')."\n" if $DEBUG; + print STDERR $m->content() if $DEBUG; } my @sub_frames = $m->find_all_links(tag_regex=>qr/^i?frame$/); for my $frame (@sub_frames) {