cesapun has asked for the wisdom of the Perl Monks concerning the following question:
Hello !
So,i have this code
#!/usr/bin/perl -w use strict; use warnings; use WWW::Mechanize; my $torrent_name = "Unmechanical-TiNYiSO"; my $cat = "Games"; my $mech = WWW::Mechanize->new( autocheck => 1);#Initializes WWW::Mech +anize ##############PRINT ON ESTORRENTS########### print "[INFO] Posting on ESTorrents!\n"; $mech->get("http://estorrents.site40.net/demo.php"); $mech->submit_form( form_id => 'addCommentForm'); $mech->field('name' , 'test'); $mech->field('body' , 'lol'); $mech->field('category' , 'Category:'); $mech->click(); print "[INFO] All Finished!\n"; #Alerts The User my $e = $mech->content(format => 'text'); print $e;
but is does not seems to work
This is the source code from that site:
<div id="addCommentContainer"> <p>Add a Torrent</p> <form id="addCommentForm" method="post" action=""> <div> <label for="name">Info</label> <input type="text" name="name" id="name" /> <label for="body">Torrent Name</label> <textarea name="body" id="body" cols="20" rows="5"></texta +rea> <label for="cat">Category</label> <input type="text" name="category" id="category" /> <input type="submit" id="submit" value="Submit" /> </div> </form> </div>
What is the problem?Because after running that script,nothing appears on that site.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Posting on a site using mechanize
by Anonymous Monk on Aug 15, 2012 at 11:03 UTC | |
by cesapun (Acolyte) on Aug 15, 2012 at 11:24 UTC | |
by Anonymous Monk on Aug 15, 2012 at 11:29 UTC | |
by cesapun (Acolyte) on Aug 15, 2012 at 11:44 UTC | |
by cesapun (Acolyte) on Aug 15, 2012 at 11:38 UTC | |
by Anonymous Monk on Aug 15, 2012 at 11:44 UTC | |
| |
Re: Posting on a site using mechanize
by Anonymous Monk on Aug 15, 2012 at 12:09 UTC | |
by cesapun (Acolyte) on Aug 15, 2012 at 12:48 UTC |
Back to
Seekers of Perl Wisdom