Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > data retrievel via perl

Reply
Thread Tools

data retrievel via perl

 
 
batista@bit.uni-bonn.de
Guest
Posts: n/a
 
      12-07-2005
Hello,

I hope that someone out there can give me a good idea for this problem.
I want to write a perl-script wich send repeatedly a ID to a www-page
(http://bioinf.charite.de/superligand...nd_search.html) to
retrieve some data. I tried the LWP-module from cpan, but this doesn't
work. The challenge is that the request is processed by an php-program,
that generates the response as html. Here my code:

my $ua = LWP::UserAgent->new;
...
my $response =
$ua->request('http://bioinf.charite.de/superligands/compound_search',
hetero => '5HT');

Is it better to call directly the php-program, and in what way can I do
this?

Thanks,
Jose

 
Reply With Quote
 
 
 
 
Sherm Pendley
Guest
Posts: n/a
 
      12-07-2005
"(E-Mail Removed)-bonn.de" <(E-Mail Removed)-bonn.de> writes:

> I hope that someone out there can give me a good idea for this problem.
> I want to write a perl-script wich send repeatedly a ID to a www-page
> (http://bioinf.charite.de/superligand...nd_search.html) to
> retrieve some data. I tried the LWP-module from cpan, but this doesn't
> work. The challenge is that the request is processed by an php-program,
> that generates the response as html.


I haven't looked at the target URL, but for filling out and submitting
dynamically-generated forms, you might have better luck with WWW::Mechanize.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
 
Reply With Quote
 
 
 
 
batista@bit.uni-bonn.de
Guest
Posts: n/a
 
      12-08-2005
>use strict;
>use warnings;
>use HTTP::Request::Common;
>use HTML::Form;
>use LWP::UserAgent;


>my $ua = LWP::UserAgent->new;
>my $request = > $ua->request( GET 'http://bioinf.charite.de/superligands/compound_search' );
>my $form = HTML::Form->parse( $request->content, $request->base() );


>#print $form->dump;
>$form->value( 'hetero', '5HT' );
>my $response = $ua->request( $form->click('B3') );
>print $response->as_string;


> Hope this helps


Yes, this works really fine. Thanks for the quick answer, this help me
a lot.

Jose

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Retrievel Hyperlinks for a web page in code Enigma Boy ASP .Net 2 08-14-2007 10:56 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments