damian1 has asked for the wisdom of the Perl Monks concerning the following question:
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 ();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize::Chrome Instagram
by jcb (Parson) on Sep 01, 2019 at 23:13 UTC | |
|
Re: WWW::Mechanize::Chrome Instagram
by nysus (Parson) on Sep 02, 2019 at 16:51 UTC | |
by damian1 (Novice) on Sep 03, 2019 at 21:00 UTC | |
by nysus (Parson) on Sep 03, 2019 at 21:31 UTC | |
by Corion (Patriarch) on Sep 04, 2019 at 07:11 UTC | |
by Corion (Patriarch) on Sep 04, 2019 at 09:27 UTC | |
by damian1 (Novice) on Sep 06, 2019 at 22:37 UTC | |
by jcb (Parson) on Sep 06, 2019 at 23:41 UTC | |
|