Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 5895
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

Owner: Nobody in particular
Requestors: todd [...]

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

Date: Fri, 2 Apr 2004 16:00:14 -0500
From: Todd Chapman <todd [...]>
To: bug-www-mechanize [...]
Subject: Feature Request: Allow modification and reparsing of HTML
Download (untitled) / with headers
text/plain 1.4k
Sometimes we know an evil website is going to return bad HTML, specifically missing end tags. It would be nice if I didn't have to touch WWW::Mechanize internals to make things work. This is what I am currently doing and it seems to work: $mech->get( "" ) or die $!; my $html = $mech->content; $html =~ s/<\/option>.?.?.?<\/td>/<\/option><\/select><\/td>/isg; $mech->{content} = $html; $mech->_parse_html; There must be a better way... -Todd Chapman ----- Forwarded message from Andy Lester <> ----- Date: Thu, 1 Apr 2004 11:02:53 -0600 From: Andy Lester <> To: Todd Chapman <> Subject: Re: Mechanize question In-Reply-To: <> User-Agent: Mutt/1.4i X-Spam-Status: No, hits=-1.5 required=3.0 tests=BAYES_01 autolearn=ham version=2.63 Local-Archive: catchall/catchall-Apr-2004 Show quoted text
> The dump prints the original HTML even though > $mech->content prints the new HTML. How can I > force a re-parse of the modified HTML?
I don't have a way to do it, but maybe I should. Submit it as a request to For now, try calling $mech->_parse_html() after you fudge the content, and let me know what happens. Better yet, if it DOES work, put that in the request, and I'll see if it makes sense to have a formal method to let you do that. xoa -- Andy Lester => => => AIM:petdance Show quoted text
----- End forwarded message -----
Thanks. Added in 0.75_02.

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

Please report any issues with to