Hello,

I have problem with module WWW::Mechanize::Chrome

I try create program to log in on Instagram. I try all capabilities but don’t log in. Log In form is dynamic in javascript.

I suppose that it is about disable status button „Log In”, but i correct complement two input fields but Log In still disabled status.What to do in this situation?

Please see my code:

#!/usr/bin/perl use strict; use warnings; use Log::Log4perl ':easy'; use WWW::Mechanize::Chrome; use open ':std', ':encoding(UTF-8)'; sub main () { my $mech; my $res; my $url; my $cookies; my $username; my $password; my $user; my $pass; my @formlist; $user = "zzz"; $pass = "www"; $url = "https://www.instagram.com/accounts/login/?source=auth_swit +cher&hl=en"; $mech = WWW::Mechanize::Chrome->new( launch_exe => 'chromium', launch_arg => ["--no-sandbox", "--disable-setuid-sandbox", + "--remote-debugging-port=9222", "--headless"], ); $mech->allow( javascript => 1 ); $mech->get($url); $mech->sleep(5); # waiting for load site $mech->form_number(1); $username = $mech->xpath('//input[@type="text"]', single => 1 ); $username->set_attribute('value', "$user"); $password = $mech->xpath('//input[@type="password"]', single => 1 +); $password->set_attribute('value', "$pass"); $mech->click({ text => 'Log In', single => 1 }); # for headless print $mech->content; return 0; } main ();

In reply to WWW::Mechanize::Chrome Instagram by damian1

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.