[Milan-pm] I need help

marcos rebelo oleber at gmail.com
Wed Apr 1 07:37:57 PDT 2009


2009/4/1 Paola Bisignano <paola.bisignano at gmail.com>:
> I decided to write both in english and Italian because I knew some people
> are foreign.
>
> ENGLISH
> I'm very new with per programming, I start with automate web surfing because
> I need to work with bioinformatics databases and when I tried to download a
> file from the web, I could'nt use command like system 'wget website....
> because download isn't direct but I passes trough a window (probably it's a
> sort of popup) that ask me to save or display...so I cannot automate
> that....I'm in trouble....
> The site is
> http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl?pdbcode=1xmj&template=ligands.html&l=1.1
> and i want to download the second postscript of the page (the one near the
> bigger figure)....If you can help me please...thank you so much and I want
> to apologize for my bad english...
>
> ITALIANO
> Ho iniziato a lavorare come bioinformatica da poco e sono nuovissima in
> Perl. Volevo chiedere se voi perlmonger potevate risolvermi un piccolo
> problema: sto elaborando degli script in perl per automatizzare la
> navigazione nel web, in particolare, alcuni database bioinformatici, e
> vorrei scaricare un file .pl che genera un poscript, per salvarlo in locale
> e estrapolare delle informazioni che mi servono. Il punto è che, navigando
> manualmente, questo file non viene scaricato automaticamente, mi apre una
> finestra che mi permette di scegliere se salvarlo o visualizzarlo, e non so
> come fare a scaricarlo, ovviamente con un comando system system
> 'wget --http://www.... non funziona proprio perchè è presente quella
> finestra intermedia, che credo sia una specie di popup....potreste
> suggerirmi un aiuto o qualche forum dove cercare...
>
> il sito di cui vi parlo è il seguente
> http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl?pdbcode=1xmj&template=ligands.html&l=1.1
> e vorrei scaricare il secondo file postscript...perchè mi serve in realtà il
> file Runningperl.pl, che viene generato quando si chiede di salvare il
> postscript, perchè ho bisogno di estrapolare delle info...
>
> grazie a tutti per la cortese attenzione
>
>
>
> _______________________________________________
> Milan-pm mailing list
> Milan-pm at pm.org
> http://mail.pm.org/mailman/listinfo/milan-pm
>
>

This list has 2 languages, Italian and English (actual lingua franca),
but you may/shall write in one. The PM Leader speaks a very peculiar
Italian and he doesn't even try to write in Italian, but you are free
to do it.



If I understood correctly, you need the last pdf in the page.

get the page html in $page.
Use: http://search.cpan.org/~gaas/libwww-perl-5.825/lib/LWP/Simple.pm

after the code:

my ($ref) = ($page =~ m|.*<a
href="(.*?)".*/thornton-srv/databases/pdbsum/templates/gif/psvers.gif|);

$ref shall finish with
"/thornton-srv/databases/cgi-bin/pdbsum/RunLigplot.pl?pdb=1xmj&file=ligplot01_01"

with "http://www.ebi.ac.uk$ref" you get the URL of the page

Best regards
Marcos rebelo

-- 
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org


More information about the Milan-pm mailing list