This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to retrieve information from NCBI/genome with Perl?

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

1 answer

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

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

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

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

Log in to answer this question.