SebMorris has asked for the wisdom of the Perl Monks concerning the following question:

Hi experts,

I am trying to log into the website: https://steamcommunity.com/login/home/?goto=market%2F and it doesn't seem to be working. My code is:

use JSON::XS; use WWW::Mechanize; use HTTP::Cookies; use LWP::Simple; use strict; use warnings; my $login = "https://steamcommunity.com/login/home/?goto=market%2F +"; my $username = "USR"; my $password = "PASS"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($login); $mech->form_name('loginForm'); $mech->field(login => $username); $mech->field(passwd => $password); $mech->click();

Any trouble shooting help would be really appreciated as after quite a while of searhing the forums I have found nothing.

Thanks in advance

Seb Morris

Replies are listed 'Best First'.
Re: Logging into a HTTPS website with perl
by Corion (Patriarch) on May 18, 2014 at 15:00 UTC

    The easy way to find this out is to just look at the HTML of the login form:

    <form id="loginForm" onsubmit="DoLogin(); return false;" name="logon" +method="POST" action="#">

    The site seems to use Javascript.

    Have you investigated what WWW::Mechanize has to say about Javascript?

      Ok, thanks for the reply, do you think you could give me a hand setting up a javascript version?