
rgabor
New User
Mar 4, 2010, 2:19 PM
Post #1 of 3
(612 views)
|
|
Win32::IE::Mechanize
|
Can't Post
|
|
Dear All, I am new in this forum, and I hope that someone can help me figure out the following. I am using Perl and Win32::IE::Mechanize to automate some task in my job. Before I have used WWW::Mechanize, but because of Java-scripts I had to switch. I can successfully connect to the site, read and submit data, however I have an issue when I want to set value for Select Option. Mechanize just cannot find the select control, so alway trow back an error. I have straggling with this since few days, and I do not found anything yet. This is the HTML code with the select
<select ID="selectTest" onchange="DoSomething(0);"> <option value="">- Select Type -</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> And this is the Perl code to set value.
#!/usr/bin/perl use warnings; use strict; use Win32::IE::Mechanize; my $mech = Win32::IE::Mechanize->new( visible => 1); $mech->get('some_url'); $mech->form_name( 'form1' ); $mech->select( 'selectTest', '2' ); If I run this, it will trow an error saying that Select 'selectTest' not found. Can someone help me on this please? Many thanks. Regards, Gabor
|