Re: HTML::Form bug

2011-10-15 Thread Rob Dixon
On 15/10/2011 07:15, Gisle Aas wrote: On Oct 15, 2011, at 0:03 , Rob Dixon wrote: Method HTML::Form::FileInput::form_name_value has been changed so that there is now a separate 'filename' field in the object. There is also code, marked as legacy, handling the old way of doing things

HTML::Form bug

2011-10-14 Thread Rob Dixon
defined $old; from the 'filename' method. Cheers, Rob Dixon

Re: LWP::Simple, get and getstore() cannot get same page as browser.

2011-06-21 Thread Rob Dixon
On 22/06/2011 00:40, Gary Yang wrote: I use get and getstore() to retrieve links. However, the page I got with “get” and “getstore()” is different than the page I got from the browser. To debug it, I copied and pasted the link below to the browser’s address bar. Then, I view the HTML source

Re: LWP post cannot get result page. LWP post did not send correct form data.

2011-06-14 Thread Rob Dixon
On 14/06/2011 09:11, Gary Yang wrote: I have been trying to learn LWP Post, by going through an examples on the web. Perl LWP. I try to search AbeBooks for the book Codex Seraphinianus from the main page (AbeBooks). Below is the code that I am using. But this just sends me back the content of

Re: LWP::UserAgent in Perl 5.8

2011-01-21 Thread Rob Dixon
On 21/01/2011 07:27, Mani, Krithika wrote: Hi, I am trying to use LWP::UserAgent class in a perl script . The version of perl is 5.8.4 . But while running the script I am getting an error Can't locate LWP/UserAgent.pm in @INC. Could you please let me know the exact library which needs to be

Re: LWP::Simple feature request: throw exception on error

2004-02-21 Thread Rob Dixon
Ed Avis rote: If LWP::Simple::get() fails it returns undef. So if you want to check for errors you do something like my $got = get($url); if (not defined $got) { # Handle error somehow, perhaps by dying } do_something_with($got); But a lot of the time,

Re: Strip tags and duplicate line feedss

2003-11-02 Thread Rob Dixon
Francis Turner wrote: David Busby wrote: I'm having trouble with the following: my $tf = HTML::TagFilter-new(strip_comments = 1); $tf-allow_tags(undef); my $clean_html = $tf-filter($res-content); But now my $clean_html has s many line feeds, tabs and spaces, wasted

Re: html tree question. clumsy ?

2003-09-24 Thread Rob Dixon
Martin Thurn wrote: I ran into similar problems for my module WWW::Search. No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse a new file. I'm pretty sure you're wrong about that. HTML::TreeBuilder subclasses HTML::Parser, which provides the 'new', 'parse',

Re: html tree question. clumsy ?

2003-09-24 Thread Rob Dixon
James.Q.L wrote: Thurn, Martin wrote: I ran into similar problems for my module WWW::Search. No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse a new file. BUT you can use the following code as a reset. I.e. call parse, muck with the tree, do the following

Re: No case on push_header

2003-09-20 Thread Rob Dixon
Gisle Aas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rob Dixon [EMAIL PROTECTED] writes: Perhaps a little better than hacking the module is to mess with the package hash %standard_case in the calling code? $HTTP::Headers::standard_case{xxx-xxx-xxx} = xxx-xxx-xxx

Re: LWP::Simple get() on win32

2003-09-20 Thread Rob Dixon
David Sanders wrote: I am having a problem with LWP::Simple::get() on a Windows XP installation. (LWP version 5.69). The following command hangs up (requiring a Cntrl-c): perl -e use LWP::Simple; my \$out=get(\http://www.cpan.org\;);print \$out but this works perl -e use

Re: question with as_html output

2003-09-19 Thread Rob Dixon
Rob Dixon wrote: Rob Dixon wrote: If you have a fixed piece of HTML that you want to add then you would still be better off coding it up using 'new_from_lol', but if the content varies then you could package the lines above as a subroutine: sub html_element { my $html

Re: question with as_html output

2003-09-19 Thread Rob Dixon
Rob Dixon wrote: Rob Dixon wrote: If you have a fixed piece of HTML that you want to add then you would still be better off coding it up using 'new_from_lol', but if the content varies then you could package the lines above as a subroutine: sub html_element { my $html = shift

Re: question with as_html output

2003-09-19 Thread Rob Dixon
Rob Dixon wrote: Rob Dixon wrote: If you have a fixed piece of HTML that you want to add then you would still be better off coding it up using 'new_from_lol', but if the content varies then you could package the lines above as a subroutine: sub html_element { my $html = shift

Re: question with as_html output

2003-09-19 Thread Rob Dixon
Rob Dixon wrote: Rob Dixon wrote: If you have a fixed piece of HTML that you want to add then you would still be better off coding it up using 'new_from_lol', but if the content varies then you could package the lines above as a subroutine: sub html_element { my $html = shift

Apology

2003-09-19 Thread Rob Dixon
Sorry for the multiple post guys. I thought there was something wrong with my kit, but it looks like the NNTP server was down for a while. Rob

Re: No case on push_header

2003-09-19 Thread Rob Dixon
Gisle Aas wrote: bob tod [EMAIL PROTECTED] writes: I need to be able to push a header into the request object without LWP converting the case of the key. eg. i do: $request-push_header(xxx-xxx-xxx,text); The actual headers recieved by the server are: Xxx-Xxx-Xxx-text Can

Re: .lwp file

2003-09-17 Thread Rob Dixon
Anindya Dey-ERM/Kolkata wrote: i have recd a file with extension .lwp please suggest a way to open the file If the file extension has been used properly then this is a Lotus Word Pro document: nothing to do with LWP. I doubt if you can open it without installing Word Pro. If it's just an

Re: question with as_html output

2003-09-17 Thread Rob Dixon
Rob Dixon wrote: If you have a fixed piece of HTML that you want to add then you would still be better off coding it up using 'new_from_lol', but if the content varies then you could package the lines above as a subroutine: sub html_element { my $html = shift; my $element = HTML

Re: question with as_html output

2003-09-16 Thread Rob Dixon
James.Q.L wrote: I am trying to add html tag to an existing html file using HTML::TreeBuiler. the problem is that the added tags isn't encoded after the output. everything els is fine. ### my $tree = HTML::TreeBuilder-new; $tree-no_space_compacting(1);

Re: question with as_html output

2003-09-16 Thread Rob Dixon
James.Q.L wrote: --- Rob Dixon [EMAIL PROTECTED] wrote: James.Q.L wrote: I am trying to add html tag to an existing html file using HTML::TreeBuiler. the problem is that the added tags isn't encoded after the output. everything els is fine. ### my $tree

Trouble with HeadParser processing a malformed comment

2003-03-02 Thread Rob Dixon
Hi all. I have been trying to automate the retrieval of data from a WWWsite which happens to have a malformed comment in the HTML head section. It looks like this: HTML HEAD ! Created on 15/10/95 Amended by CH for Leicestershire etc 22/08/2001 - TITLELibrary Catalogue/TITLE META

Which is the 'referer'

2003-01-31 Thread Rob Dixon
Hi Could somebody tell me which URL should be used in the Referer header when a link is followed from a document which is the result of one or more redirections? Is it the original document that was requested or the final one which comes with a success status code? Also, is there any part of LWP

Re: Cookies again!

2003-01-31 Thread Rob Dixon
Hi Jonathan. Jonathan Daigle wrote: hi! i had set $cookies_file = HTTP::Cookies-new(); $ua-cookie_jar($cookies_file); $ua-request(get $url_page) should this work? Yes, that looks fine, as long as you don't want a persistent cookie jar. (You'll have an new empty one every time you run the

Re: Which is the 'referer'

2003-01-31 Thread Rob Dixon
Doug Monroe [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Rob Dixon wrote: Hi Could somebody tell me which URL should be used in the Referer header when a link is followed from a document which is the result of one or more redi

Re: LWP::Simple script gives 500 error

2003-01-15 Thread Rob Dixon
Matt Ashby wrote: Dear All, I am trying to run the following script on my hosted web space, but when I do I get a 500 Server Error. When I run the script on a command line on a separate server it works perfectly. I have tried giving the file all sorts of permissions, but it won't work.

Re: Can't pass hash?

2002-12-19 Thread Rob Dixon
The third argument to HTTP::Request-new is an HTTP::Headers object. Try my $request = HTTP::Request-new(POST=$action, HTTP::Headers-new (%args)); HTH, Rob Chris Greenhill [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I can't seem to pass a hash to

Re: Executing embedded JavaScript

2002-12-19 Thread Rob Dixon
Thanks Doug, but all I've found is some posts where people want to follow JS-encoded redirections and refreshes. The general case, where Perl provides most of the document object model for JS to manipulate, doesn't seem to have been addressed. I've been looking at SpiderMonkey, which seems to be

Re: lwp and content() responses

2002-11-30 Thread Rob Dixon
Nathan I'm not clear whether you're getting /html or not. Try dumping the returned value with $response-as_string to see exactly what you're getting. Also examine $response-status_line to check for anything other than a success. HTH, Rob - Original Message - From: Agrin, Nathan [EMAIL

RE: :UserAgent - browser simulation

2001-08-30 Thread Rob Dixon
$request-header ('Referer' = $url) HTH, Rob -Original Message- From: Marc Power [mailto:[EMAIL PROTECTED]] Sent: 30 August 2001 16:36 To: [EMAIL PROTECTED] Subject: LWP::UserAgent - browser simulation How can I set the REFERER variable in the request, please? best,