Skip Menu |
 

This queue is for tickets about the HTTP-Recorder CPAN distribution.

Report information
The Basics
Id: 8243
Status: open
Priority: 0/
Queue: HTTP-Recorder

People
Owner: leira [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] follow_link expects trimmed undecoded text
Download (untitled) / with headers
text/plain 144b
follow_link expects trimmed text, and all HTML entities should be turned into text. The attached patch fixes this problem. Regards, Slaven
Download Logger.pm.diff
text/x-diff 876b
--- Logger.pm.orig 2004-11-04 17:52:52.000000000 +0100 +++ Logger.pm 2004-11-04 17:58:41.000000000 +0100 @@ -3,6 +3,7 @@ use strict; use warnings; use LWP::MemberMixin; +use HTML::Entities qw(decode_entities); our @ISA = qw( LWP::MemberMixin ); sub new { @@ -102,6 +103,9 @@ if ($args{text}) { $args{text} =~ s/"/\\"/g; + # follow_link expects trimmed undecoded text, see HTTP::TokeParser::get_trimmed_text + $args{text} =~ s/^\s+//; $args{text} =~ s/\s+$//; $args{text} =~ s/\s+/ /g; + $args{text} = decode_entities $args{text}; $self->Log("follow_link", "text => \"$args{text}\", n => \"$args{index}\""); } else {
Download (untitled) / with headers
text/plain 260b
[SREZIC - Thu Nov 4 11:59:44 2004]: Show quoted text
> follow_link expects trimmed text, and all HTML entities should be > turned into text. The attached patch fixes this problem.
Can you give me an example of a simple page that demonstrates this problem? Thanks, Linda
From: srezic [...] cpan.org
Download (untitled) / with headers
text/plain 697b
[LEIRA - Sun Aug 14 02:53:23 2005]: Show quoted text
> [SREZIC - Thu Nov 4 11:59:44 2004]: >
> > follow_link expects trimmed text, and all HTML entities should be > > turned into text. The attached patch fixes this problem.
> > Can you give me an example of a simple page that demonstrates this > problem? >
See the attached html file. The generated log file has the following line after clicking on the link: $agent->follow_link(text => " Spaces in between ", n => "1"); If the logfile is executed, then WWW::Mechanize croaks: ' Spaces in between ' is space-padded and cannot succeed at myfile line After removing the spaces completely WWW::Mechanize works fine. Regards, Slaven
Download a.html
text/html 270b


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.