473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

Expand|Select|Wrap|Line Numbers
  1. #!c:\perl\bin\perl.exe
  2.  
  3. use strict;
  4. use HTTP::Cookies;
  5. use LWP::debug qw(+);
  6. use Win32::IE::Mechanize;
  7.  
  8. my $outfile = "out.htm";
  9. my $url = "http://www.mindsrc.com/index.php?id=careers_submit";
  10.  
  11. my $mech= Win32::IE::Mechanize->new();
  12. $mech->get($url);
  13.  
  14. sleep 10;
  15.  
  16. $mech->form_name("subapp");
  17.  
  18. my $f = "14232";
  19. my $l = "6847";
  20.  
  21. sleep 5 ;
  22. $mech->field(first => $f);
  23.  
  24. $mech->click();
  25.  
  26. #use LWP::debug qw(+);
  27.  
  28. my $output_page = $mech->content;
  29.  
  30.  
  31. open(OUTFILE, ">$outfile");
  32. print OUTFILE "$output_page";
  33. print $output_page;
  34.  
  35. close(OUTFILE);

Kindly guide me how can I get over this issue.

Mithun
Mar 21 '08 #1
2 2146
Hello All,

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

Mithun
Mar 21 '08 #2
KevinADC
4,059 Expert 2GB
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::Mechanize 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:
Expand|Select|Wrap|Line Numbers
  1. $mech->get($url);
Don't you maybe need to assign the retun value of $mech->get() to another variable?

Expand|Select|Wrap|Line Numbers
  1. 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.
Mar 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ajay Brar | last post by:
hi! i get a value error when parsing an xml file. This is because it can't find the DTD - ValueError: unknown url type: ../um_xml/um.dtd From what i have discovered in the archives, this...
0
by: Gene Mat | last post by:
Hi, I'm trying to build a simple Perl program to get a list of newsgroups. Here's what I have... #!/opt/local/bin/perl use Net::NNTP; $nntp = Net::NNTP->new("nntp.perl.org",Debug,10);...
7
by: matthew_carver | last post by:
Hello, I have an ASP page that loops through a SQL Server 2000 table, then downloads an Excel sheet the users can save, etc. Works fine, except, I see that in one particular "comments" field the...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
2
by: Keith | last post by:
I have populated (or created a collection) in a ComboBox. However - I would like to set a default value - when my form is first opened (for the ComboBox) - like "Select topic" However - when I...
3
by: Harvey Triana | last post by:
Hi-- Sample. When i write something like: <input type="button" name="btnSend" value="Send" onclick="callSomeTask(getElementById('myControl').value );return false; /> I can run some cliente...
2
by: preeti13 | last post by:
Hi guys i am here with my another probelm please help me.trying insert the value into the data base but getting the null value error .I am getting thsi error Cannot insert the value NULL into...
1
by: mithunmo | last post by:
If I run the below 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...
7
by: adigga1 | last post by:
Hello EveryOne, I have a situation with a Form running an event; It works fine when it calls or manipulates number values; but when I put a character within the numbers or use alpha-numeric...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.