Submitting a form with two identically named fields using WWW::Mech

2007-05-16 Thread Peteris Krumins [Newsgroups]
Hello! I was programming some web automation stuff using Mech and found the following. Suppose someone not too skillful at designing HTML forms had made a form with two elements, a checkbox and a text field, and both assigned the same name 'element_name'. Now if I call Mech's submit_form()

Re: Submitting a form with two identically named fields using WWW::Mech

2007-05-16 Thread Peteris Krumins [Newsgroups]
Andy Lester wrote: On May 16, 2007, at 3:46 PM, Peteris Krumins [Newsgroups] wrote: Now if I call Mech's submit_form() and specify both fields, the Mech would die with the following error: Illegal value 'false' for field 'element_name' at Mechanize.pm line ... Can you give a specific

Submitting a form with relative path specified in form's action using WWW::Mechanize

2007-05-19 Thread Peteris Krumins [Newsgroups]
Hello! Suppose a form is located at an URL http://host.com/path/to/form and the form's action path is relative, like this: form action=path/to/form If I submit this form, the WWW::Mechanize will POST the data to http://host.com/path/to/path/to/form which seems right at the first glance

WWW::Mechanize does not decompress content.

2007-05-20 Thread Peteris Krumins [Newsgroups]
Hello. I was downloading an image which was gzip compressed by the server but the WWW::Mech did not decompress it. Usually it does but not from this particular site. Here is an example program which will get the image from that particular site and write the content to 'picture.jpg'. I

POST-ing a file with WWW::Mechanize

2007-06-03 Thread Peteris Krumins [Newsgroups]
Hello! When POST-ing files with LWP I could usually specify the field as an array ref which looked like this: /fieldname/ = [/local_filespec/ = /as_what_name/], Now, I am trying to do the same with WWW::Mech and what I get is Mech dying with error: /Can't call method value on an undefined

LWP::Parallel::UserAgent's constructor

2007-06-12 Thread Peteris Krumins [Newsgroups]
Hello! I wonder why the LWP::Parallel::UA's constructor does not take and pass LWP's options to the LWP?! Seems something obvious to do when programming a lib which isa LWP. P.Krumins

Tunneling LWP https requests through an existing socket.

2007-06-26 Thread Peteris Krumins [Newsgroups]
Hello! Any ideas how I could re-use an existing socket (for example IO::Socket::Socks connection to a socks proxy server) to send https traffic through it? The problem which I am facing is that there seems to be no way I can tell Net::SSL package to use an existing file handle/socket for

Is LWP threads safe?

2007-06-27 Thread Peteris Krumins [Newsgroups]
Hello! Can anyone tell me if LWP is threads safe? I am maintaining this project and it already uses threads and I need to add functionality which LWP ideally suits for. And I can't change the project at this stage to use a non-thread based multiprocessing. P.Krumins

Re: Tunneling LWP https requests through an existing socket.

2007-06-27 Thread Peteris Krumins [Newsgroups]
Peteris Krumins [Newsgroups] wrote: Hello! Any ideas how I could re-use an existing socket (for example IO::Socket::Socks connection to a socks proxy server) to send https traffic through it? The problem which I am facing is that there seems to be no way I can tell Net::SSL package to use

Re: Tunneling LWP https requests through an existing socket.

2007-06-27 Thread Peteris Krumins [Newsgroups]
Peteris Krumins [Newsgroups] wrote: Peteris Krumins [Newsgroups] wrote: Hello! Any ideas how I could re-use an existing socket (for example IO::Socket::Socks connection to a socks proxy server) to send https traffic through it? The problem which I am facing is that there seems to be no way

LWP::Parallel::UserAgent default headers patch

2007-07-03 Thread Peteris Krumins [Newsgroups]
Hello! I was playing around LWP::Parallel::UserAgent and noticed that if I set default_headers() which is LWP::UserAgent's method, the parallel UA never used them for requests. This little patch ensures that the default headers are added to each parallel ua's request. P.Krumins ---