Hi,
I am trying to download a text file from a URL:
http://modbase.compbio.ucsf.edu/modb...abaseID=P21812There is a tutorial for this service:
http://modbase.compbio.ucsf.edu/modb....html#retrieveThat basically says that I should use cookies in order to be able to
retrieve my text file from the URL.
So I did this:
my $url = "http://salilab.or/modbase/retrieve/modbase?databaseID=P21812";
my $browser = LWP::UserAgent->new;
use HTTP::Cookies;
my $cookie_jar = HTTP::Cookies->new(
'file' => '/home/mrdvd030/.cookies/cookies.lwp',
# where to read/write cookies
'autosave' => 1,
# save it to disk when done
);
$browser->cookie_jar( $cookie_jar);
my $response = $browser->get( "http://salilab.or/modbase/retrieve/modbase?databaseID=P21812", ':content_file' => "/home/mrdvd030/test");
print "response: " . $response;
In /home/mrdvd030/.cookies/ I put a text file called cookies.lwp that contains the following text:
modbase.compbio.ucsf.edu FALSE / FALSE 2116975226 modbase-academic modbase_user&anonymous&modbase_passwd&anonymous
I then executed my code, and here what I get:
teste: /home/mrdvd030/.cookies/cookies.lwp does not seem to contain cookies at /usr/share/perl5/HTTP/Cookies.pm line 432, <FILE> line 1.
If I look up in my cookie, contain has now change and is:
#LWP-Cookies-1.0
What is wrong in my proceedure? Any help would be appreciated.