Wednesday, 8 October 2014

Test 16: show various direct methods with Mech

Test:
Use the methods which can be directly used with $m->

Learning: 
Various direct methods with $m->



Solution:

use strict;
use warnings;

use WWW::Mechanize;

my $m = WWW::Mechanize->new();
$m->get("http://www.rediff.com");

print "URL is- ".$m->uri()."\n";

print "Status code is- ".$m->status()."\n";

print "Content type is- ".$m->content_type()."\n";

print "Base URI is- ".$m->base()."\n";

print "is content HTML- ".$m->is_html()."\n";

print "title is- ".$m->title()."\n";


output snapshot:

No comments:

Post a Comment