post data script

Discussion in 'Programming' started by ssimon171078, Apr 2, 2010.

  1. #1
    i write perl script that i can login to olx.com but i have errors,i need help to correct script

    my perl script:
    
    #!/usr/bin/perl
    
    use WWW::Mechanize;
    use strict;
    
      print "Content-type: text/html\n\n";
    
      my $username = "user";
      my $password = "pass";
      my $outfile = "out.txt";
    
      my $mech = WWW::Mechanize->new( );
    
      my $url = 'http://www.olx.com/login.php';
    
      $mech->get($url);
      $mech->form_name('loginform');
      $mech->field(username => "$username");
      $mech->field(passwd => "$password");
      $mech->click();
    
      my $response = $mech->content();
       print $response;
    
    
    
    Code (markup):

     
    ssimon171078, Apr 2, 2010 IP
  2. iandracaster

    iandracaster Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this:

    good luck ...
     
    iandracaster, Apr 2, 2010 IP