I am trying to download a text file from a URL:
There is a tutorial for this service:
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;
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
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:
What is wrong in my proceedure? Any help would be appreciated.