From 80f2a9ed154cb4aa2b76b38de31ec6f9cf0f1b97 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 1 Dec 2010 06:03:49 +0000 Subject: [PATCH] be mozilla and add cookie jar --- get_pdf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.39.2