title: Loggin into website with LWP and Perl
body: <p>Somewhat inexperienced programmer here trying to write a program to log into my courses site and download all the content (lectures homeworks etc). Obviously it is a password protected site so I have to give it that.  I understand LWP::UserAgent and the likes well enough, and that I need to use credentials.  What I cannot figure out is how to get to the next page.  I can go to the log-in, but how does perl get the result of my log-in?</p>
  
  <p>code example (i pulled out the log-info obviously):</p>
  
  <pre><code>use LWP::UserAgent;
  
  my $ua = LWP::UserAgent-&gt;new;
  my $url = 'login URL';
  $ua -&gt; credentials(
    $url,
    '',
    'user',
    'pass'
  );
  my $response = $ua -&gt;get($url);
  print $response-&gt;content; 
  </code></pre>
  
  <p>the content from response is the same content as what I would have got as if I had not passed any credentials.  Obviously I'm missing something here....</p>
  
  <p>Oh one other thing my own courses site does not have a unique url as far as I know.</p>