ckj has asked for the wisdom of the Perl Monks concerning the following question:
Hi M<onks,
if any one can help me in this then it would be very great.
my code is:
UPDATE: I'm using perl 5.14 and HTTP::Response version is 6.01#!/usr/bin/perl use WWW::Mechanize; use warnings; my $mech = WWW::Mechanize->new(); my $mechx = WWW::Mechanize->new(autocheck => 0, autodie => 0); my $url = 'http://www.topbuy.com.au'; $mech->get($url); $content= $mech->content; if($content=~/id="topbuy-nav-category-wrapper">(.*?)id="topbuy-nav-fea +tures"/isxm){ $c = $1; @urls=''; while($c=~/href=(http.*?\.html)/gixsm){ $a_l = $1; if($a_l~~@urls){} else{push(@urls, "$a_l");} } } foreach $url (@urls) { continue_shopping($url); $mech->get($url) or die $!; $con1 = $mech->content(); $row = 0; while($con1 =~/<h5>(.*?)<\/h5>.*?"topbuy-subcategory">(.*?)<\/ul>/ +gisxm){ print "$1:$2\n"; } } sub continue_shopping{ my $a= shift; print $a; $mechx->get($a); $related = ''; $mechx->get("http://www.topbuy.com.au/avail/index/categorylv"); $txt = $mechx->content; while($txt=~/catalog\/product\/detail\/(.*?.jpg)/gisxm){ $related = $1.', '.$related; } print $related; }
But after running evrey time , I'm getting the error like: Missing base argument at C:/Perl/lib/HTTP/Response.pm line 93
I searched a lot for this and tried in that way too but it's giving the same error all the time.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: WWW::Mechanize error: Missing base argument at C:/Perl/lib/HTTP/Response.pm line 93
by Anonymous Monk on Nov 06, 2012 at 09:24 UTC | |
Re: WWW::Mechanize error: Missing base argument at C:/Perl/lib/HTTP/Response.pm line 93
by Anonymous Monk on Nov 06, 2012 at 09:30 UTC | |
by space_monk (Chaplain) on Nov 06, 2012 at 11:01 UTC | |
Re: WWW::Mechanize error: Missing base argument at C:/Perl/lib/HTTP/Response.pm line 93
by space_monk (Chaplain) on Nov 06, 2012 at 08:36 UTC |
Back to
Seekers of Perl Wisdom