Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: Correct link to put in my WWW:Mechanize

by Anonymous Monk
on Mar 12, 2022 at 18:59 UTC ( [id://11142038]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Correct link to put in my WWW:Mechanize
in thread Correct link to put in my WWW:Mechanize

Sorry Rolf, I am a bit confused. In my script, I write:
my $url = 'http://www.csbio.sjtu.edu.cn/bioinf/MemBrain/';

and, in the source of the page I see:
<form name="myform" action="/cgi-bin/MEMBRAIN.cgi" method="post" onSub +mit="javascript: return checkform();">

Do these two need to be combined perhaps somehow?

Replies are listed 'Best First'.
Re^5: Correct link to put in my WWW:Mechanize
by LanX (Saint) on Mar 12, 2022 at 19:03 UTC
    > Sorry Rolf, I am a bit confused. In my script, I write:
    'my $url = 'http://www.csbio.sjtu.edu.cn/bioinf/MemBrain/';'

    That's not the code you showed us.

    > and, in the source of the page I see:
    <form name="myform" action="/cgi-bin/MEMBRAIN.cgi" method="post" onSubmit="javascript: return checkform();">

    you are confusing two things:

    1. the static page you open in your browser to see the form
    2. the CGI you can submit your form parameters to.
    Which one do you want to mechanize? I can't tell.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      I guess this is where I am confused, as to what do I need to specify in the URL so I can force the page to run using my data. I thought it was enough to put:
      my $url = 'http://www.csbio.sjtu.edu.cn/bioinf/MemBrain/'; my $mech = WWW::Mechanize->new (timeout=>1000); $mech->post($url); #$mech->get($url);

      but it fails to run with the error: Error POSTing http://www.csbio.sjtu.edu.cn/cgi-bin/MEMBRAIN.cgi: Internal Server Error or Error GETing http://www.csbio.sjtu.edu.cn/cgi-bin/MEMBRAIN.cgi: Internal Server Error
      I even tried: my $url=http://www.csbio.sjtu.edu.cn/cgi-bin/MEMBRAIN.cgi, still error...
Re^5: Correct link to put in my WWW:Mechanize
by Anonymous Monk on Mar 12, 2022 at 19:00 UTC
    Also, this one does not point somewhere: http://www.csbio.sjtu.edu.cn/bioinf/MemBrain/cgi-bin/MEMBRAIN.cgi --> The requested URL /bioinf/MemBrain/cgi-bin/MEMBRAIN.cgi was not found on this server.
      It's

      http://www.csbio.sjtu.edu.cn/cgi-bin/MEMBRAIN.cgi

      for the form's CGI!

      ... but without submitted form parameters it'll only return an error.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        Yes, of course, I added some:
        my $url = 'http://www.csbio.sjtu.edu.cn/cgi-bin/MEMBRAIN.cgi'; my $mech = WWW::Mechanize->new (timeout=>1000); $mech->get($url); $mech->submit_form ( form_number => 1, fields => { #textarea name | value S1 => ">$id\n$seq", #Radio button name | prediction type R4 => TOPpre, #Radio button SIGNAL | I do not know if I have a signa +l peptide R2 => SignalYES, #Radio button ORGANISM | Human, Plant, Animal, OEuk, G +pos, Gneg, R3 => Human, #Fill in email email => 'testmail@gmail.com' } );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11142038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-24 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found