title: Perl WWW::Mechanize Instagram
body: <p>Is it possible to use WWW::Mechanize in Perl code to login on Instagram? When I load the login form under <a href="https://www.instagram.com/accounts/login/?source=auth_switcher" rel="nofollow noreferrer">https://www.instagram.com/accounts/login/?source=auth_switcher</a> my code shows an error that it cannot find the login form.</p>
  
  <pre><code>my $browser;
  my $res;
  my $url;
  
  my $username;
  my $password;
  my @formlist;
  
  $username = "aaa";
  $password = "bbb";
  
  $browser = WWW::Mechanize-&gt;new();
  
  $url = "https://www.instagram.com/accounts/login/?source=auth_switcher";
  $browser-&gt;get($url);
  
  $browser-&gt;form_number(1);
  $browser-&gt;field("username", $username);
  $browser-&gt;field("password", $password);
  $browser-&gt;click();
  </code></pre>