NAME
eBay::API::Simple::HTML - Support for grabbing an HTML page via API call
USAGE
my $call = eBay::API::Simple::HTML->new();
$call->execute( 'http://en.wikipedia.org/wiki/Main_Page' );
if ( $call->has_error() ) {
die "Call Failed:" . $call->errors_as_string();
}
# getters for the response DOM or Hash
my $dom = $call->response_dom();
my $hash = $call->response_hash();
# collect all h2 nodes
my @h2 = $dom->getElementsByTagName('h2');
foreach my $n ( @h2 ) {
print $n->findvalue('text()') . "\n";
}
PUBLIC METHODS
new( { %options } }
my $call = ebay::API::Simple::HTML->new();
execute( $url )
$call->execute( 'http://en.wikipedia.org/wiki/Main_Page' );
This method will construct the API request based on the $verb and the $call_data and then post the request to the web service endpoint.
Options
response_hash
Custom response_hash method, uses the output from LibXML to generate the hash instead of the raw response body.
response_dom
Custom response_dom method, provides a more relaxed parsing to better handle HTML.
BASECLASS METHODS
request_agent
Accessor for the LWP::UserAgent request agent
request_object
Accessor for the HTTP::Request request object
request_content
Accessor for the complete request body from the HTTP::Request object
response_content
Accessor for the HTTP response body content
response_object
Accessor for the HTTP::Request response object
nodeContent( $tag, [ $dom ] )
Helper for LibXML that retrieves node content
errors
Accessor to the hashref of errors
has_error
Returns true if the call contains errors
errors_as_string
Returns a string of API errors if there are any.
PRIVATE METHODS
_get_request_body
This method supplies the XML body for the web service request
_get_request_headers
This methods supplies the headers for the HTML API call
_get_request_object
This method creates the request object and returns to the parent class
AUTHOR
Tim Keefer <tim@timkeefer.com>
COPYRIGHT
Tim Keefer 2009