LWP::UserAgent::FramesReady - a frames-capable version of LWP::UserAgent


use LWP::UserAgent::FramesReady;

$ua = new LWP::UserAgent;

$response = $ua->request($http_request);


LWP::UserAgent::FramesReady is a version of LWP::UserAgent that is smart enough to recognize the presence of frames in HTML and load them automatically.

Because a framed HTML page actually consists of several HTML pages and requires more than one HTTP response, LWP::UserAgent::FramesReady returns framed pages as HTTP::Response::Tree objects. Simple responses are still returned as HTTP::Response objects.


LWP::UserAgent::FramesReady inherits most of its methods from LWP::UserAgent. The following method is changed from the LWP::UserAgent version:


This behaves like LWP::UserAgent's request method, except that it takes only one parameter (an HTTP::Request object as usual). Further parameters may generate a warning and be ignored. Such attempts usually are due to a proxy request, redirect override, authentication or moved file condition that the base class function can handle properly, anyway.

In addition to request()'s usual behavior (authenticating, following redirects, etc.), this will attempt to follow frames if it detects an HTML page that contains them. All responses collected as a result of following frames will be returned in an HTTP::Response::Tree object.

The following method is new:


This gets or sets the maximum depth that the user agent is allowed to go to fetch framed pages. 0 means it will not fetch any frames, 1 means it will fetch only the frames for the topmost page and not any sub-frames, and so on. The default is 3.


Processing other embedded objects in an HTML page is similar to processing frames. Perhaps someday there will be yet another version of this that can also handle things like in-line images, layers, etc.


Any known bugs will be noted here and documented in the source with "BUG:" in the comments.


Copyright 2002 N2H2, Inc. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 147:

=back doesn't take any parameters, but you said =back 4