How to retrieve information from NCBI/genome with Perl?
1
0
Entering edit mode
10.3 years ago
fr ▴ 210

Hello!

I'm trying to retrieve the information under "Representative" in a bunch of NCBI pages (e.g. here). For this I was trying to use the following code, which yields 'undef'.

#!/usr/local/bin/perl
use strict;
use warnings;
use autodie;
use Data::Dump;

use LWP::Simple qw(get);

my $content=get('http://www.ncbi.nlm.nih.gov/genome/?term=Xylella_fastidiosa');

dd $content;

So my questions are the following:

  1. Why can't I get the information on the page?
  2. Is there any other way to retrieve it? Maybe some other package that actually works?

Thanks

perl ncbi • 3.6k views
ADD COMMENT
0
Entering edit mode
10.3 years ago
Neilfws 49k

I just ran your code and it returned HTML content as expected. Maybe a transient network issue?

ADD COMMENT
0
Entering edit mode

yeah, I'm starting to think that it has something to do with my side...

ADD REPLY
0
Entering edit mode

What I don't understand is why I can't get the page with Perl but I can still access it with the browser

ADD REPLY
0
Entering edit mode

I can't believe it was a problem on my antivirus' firewall... how stupid is this

ADD REPLY

Login before adding your answer.

Traffic: 1659 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6