Hi all,

I have tried to automate bittorrent site (browsing). So there it requires username and password. and then click button sign in. but i didn't find any ways login (enter next field) so. below are the ways i have tried ,please assist me if any mistakes.....

1st Method:-
use WWW::Mechanize; my $m = WWW::Mechanize->new( autocheck => 1 ); $m->get("https://www.bittorrent.com/account/signin"); $mech->submit_form( form_name => 3, #I don't know what is this simply i gave fields => { username => "abcd", password => "abcd", }, button => 'Sign In', );
2nd Method:-
use WWW::Mechanize; use HTTP::Cookies; my $outfile = "Result.htm"; my $url = "https://www.bittorrent.com/account/signin"; my $username = "abcd"; my $password = "abcd"; my $cookiefile = 'cookies.txt'; my $cookie_jar = HTTP::Cookies->new(File => $cookiefile, autosave =>1) +; my $mech = WWW::Mechanize->new(); $mech->cookie_jar($cookie_jar); $mech->get($url); print "form submit failed!", $mech->response->status_line, "\n" unless + $mech->success; $mech->set_visible( $username ); $mech->click_button(value => "Sign In");
3rd Method:-
use WWW::Mechanize; use URI::URL; use LWP::Simple; $url="https://www.bittorrent.com/account/signin"; $m=WWW::Mechanize->new(); $m->get($url); $content=$m->content; open(FD,">>html"); print FD "$content\n"; $username="shekar"; $password="shekar"; $m->set_visible($username,$password); $m->submit();

Please Sugest me to overcome this problem.... you can mail me @ shekarkcb@gmail.com

regards shekar

In reply to problem login using WWW::Mechanize by shekarkcb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.