Can't call method "value" error when running perl script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mithunmo
    New Member
    • Mar 2008
    • 5

    Can't call method "value" error when running perl script

    I am trying to automate the process of filling up the webforms and do a submit .
    I have the below program written but If I run the program . I get the following error message
    Can't call method "value" on an undefined value at C:/Perl/site/lib/Win32/IE/Mec
    hanize.pm line 900.

    Please let me know your inputs on the same

    [CODE=perl]
    #!c:\perl\bin\p erl.exe

    use strict;
    use HTTP::Cookies;
    use LWP::debug qw(+);
    use Win32::IE::Mech anize;

    my $outfile = "out.htm";
    my $url = "http://www.mindsrc.com/index.php?id=ca reers_submit";

    my $mech= Win32::IE::Mech anize->new();
    $mech->get($url);

    sleep 10;

    $mech->form_name("sub app");

    my $f = "14232";
    my $l = "6847";

    sleep 5 ;
    $mech->field(first => $f);

    $mech->click();

    #use LWP::debug qw(+);

    my $output_page = $mech->content;


    open(OUTFILE, ">$outfile" );
    print OUTFILE "$output_pa ge";
    print $output_page;

    close(OUTFILE);[/CODE]


    Kindly guide me how can I get over this issue.

    Mithun
    Last edited by eWish; Mar 21 '08, 12:32 PM. Reason: Pleaser use [code][/code] tags
  • mithunmo
    New Member
    • Mar 2008
    • 5

    #2
    Hello All,

    Can anyone guide me on this. it is a bit urgent . Thanks in advance !

    Mithun

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      Originally posted by mithunmo
      Hello All,

      Can anyone guide me on this. it is a bit urgent . Thanks in advance !

      Mithun

      The error is coming from the Win32::IE::Mech anize module:

      Win32/IE/Mechanize.pm line 900
      Some value it needs to run the "value" method is not defined. This line looks suspicious to me:
      Code:
      $mech->get($url);
      Don't you maybe need to assign the retun value of $mech->get() to another variable?

      Code:
      my $foo = $mech->get($url);
      Please note, there is no urgent help here, or kinda urgent help here. Your question has the same priority as all questions posted: none. They are answered if and when someone wants to answer them.

      Comment

      Working...