Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

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


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

Hi Rolf, many thanks for trying to help out and apologies if I seem to not get it... I tried your code (which I think is pretty much what I have now), and the error still the same.
use WWW::Mechanize(); while(<>) { if($_=~/^>(.*)/) { my $id=$1; my $seq=<>; chomp $seq; print "$id\n"; my $url = 'http://www.csbio.sjtu.edu.cn/bioinf/MemBrain/'; #what + I see in the browser, as you said my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->submit_form ( form_name => 'myform', fields => { #textarea name | value S1 => ">$id\n$seq", #Radio button one with value (parameter 1) R4 => 'TOPpre', #Radio button one with value (parameter 2) R2 => 'SignalYES', #Radio button one with value (parameter 3) R3 => 'Human', #Fill in email (parameter 4) email => 'myemail@gmail.com' } ); } }

The code executes until I print the id and then exits, with the error that I have posted earlier. I specified the form_name too, but nothing...

Replies are listed 'Best First'.
Re^12: Correct link to put in my WWW:Mechanize
by LanX (Saint) on Mar 12, 2022 at 22:36 UTC
    You didn't provide a SSCCE because your input is read manually.

    My guess is that your data is wrong. I also get an error with random data.

    So please test the validity on the website manually.

    And try to disable JS in your browser to see if it's needed.

    WWW::Mechanize can't do JS.

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found