in reply to Re^6: select fields and mechanize
in thread select fields and mechanize

That is not : a test; a bug report; a self-contained runnable program that demonstrates your problem. Ex
#!/usr/bin/perl -- use strict; use warnings; use WWW::Mechanize 1.60; my $ua = WWW::Mechanize->new( autocheck => 1, ); #~ use URI::file; #~ $ua->get( URI::file->new( __FILE__ )->abs(URI::file->cwd) ); $ua->get( 'file:'.__FILE__); $ua->update_html( <<'HTML'); <html> <head> <title> </title> </head> <body> <form> <select name="cargear" id="cargear"> <option value='0' >All</option> <option value='2' >Automatic</option> <option value='4' >No gear</option> <option value='1' >Manual</option> </form> </body> </html> HTML print $ua->dump_all,"\n\n"; $ua->select("cargear", "Manual"); print $ua->dump_all,"\n\n"; $ua->submit; __END__ $ perl -MDevel::ModList mechanize.select.vd.pl GET file:mechanize.select.vd.pl cargear=0 (option) [*0/All|2/Automatic|4/No g +ear|1/Manual] GET file:mechanize.select.vd.pl cargear=1 (option) [:0/All|2/Automatic|4/No g +ear|*1/Manual] Error GETing file:mechanize.select.vd.pl?cargear=1: File `mechanize.se +lect.vd.pl?cargear=1' does not exist at mechanize.select.vd.pl line 3 +5 AutoLoader 5.70 Carp 1.11 Carp::Heavy Compress::Raw::Zlib 2.024 Compress::Zlib 2.024 Config Config_git.pl Config_heavy.pl Devel::ModList DynaLoader 1.10 Encode 2.39 Encode::Alias 2.12 Encode::Config 2.05 Encode::Encoding 2.05 Exporter 5.63 Exporter::Heavy 5.63 Fcntl 1.06 File::Basename 2.77 File::Glob 1.06 File::GlobMapper 1.000 File::Spec 3.31 File::Spec::Unix 3.3 File::Spec::Win32 3.3 FileHandle 2.02 HTML::Entities 3.64 HTML::Form 5.829 HTML::Parser 3.64 HTML::PullParser 3.57 HTML::Tagset 3.20 HTML::TokeParser 3.57 HTTP::Config 5.815 HTTP::Cookies 5.833 HTTP::Cookies::Netscape 5.832 HTTP::Date 5.831 HTTP::Headers 5.827 HTTP::Headers::Util 5.817 HTTP::Message 5.834 HTTP::Request 5.827 HTTP::Request::Common 5.824 HTTP::Response 5.824 HTTP::Status 5.817 IO 1.25 IO::Compress::Adapter::Deflate 2.024 IO::Compress::Base 2.024 IO::Compress::Base::Common 2.024 IO::Compress::Gzip 2.024 IO::Compress::Gzip::Constants 2.024 IO::Compress::RawDeflate 2.024 IO::Compress::Zlib::Extra 2.024 IO::File 1.14 IO::Handle 1.28 IO::Seekable 1.1 IO::Uncompress::Adapter::Inflate 2.024 IO::Uncompress::Base 2.024 IO::Uncompress::Gunzip 2.024 IO::Uncompress::RawInflate 2.024 LWP 5.834 LWP::MediaTypes 5.822 LWP::MemberMixin LWP::Protocol 5.829 LWP::Protocol::file LWP::UserAgent 5.834 List::Util 1.22 Scalar::Util 1.22 SelectSaver 1.02 Storable 2.21 Symbol 1.07 Time::Local 1.1901 URI 1.52 URI::Escape 3.29 URI::_generic URI::_query URI::file 4.20 URI::file::Base URI::file::Win32 WWW::Mechanize 1.60 XSLoader 0.10 base 2.14 bytes 1.03 constant 1.19 integer 1.00 overload 1.07 re 0.09 utf8 1.07 vars 1.01 warnings 1.06 warnings::register 1.01 $
Obviously it works perfectly as advertised/expected for me :)

Replies are listed 'Best First'.
Re^8: select fields and mechanize
by Kvantum (Initiate) on Feb 21, 2010 at 19:26 UTC
    Re^8: select fields and mechanize
    by Kvantum (Initiate) on Feb 21, 2010 at 19:28 UTC

      I've worked a litle more on this problem.

      It seams that utf8 encoding doens't work correct. The select fields and fields i'm working in are in greek. It looks like it doen't recognize the options in selectfields and the content in fields are transmited with strange chars in them.

      try with this options below in the test provided by you and you will see.

      option 1 - Δεν Εχει

      option 2 - Μ/Τ Μηχανικό κιβώτιο

      option 3 - Α/Τ Αυτόματο κιβώτιο

      Another strange thing is that before it worned when I tryed to select an option that didn't existed in the select feiled. Now it doesn't.

      /Kvantum