I was thinking it would look something like my @game = qr(@_); but I couldn't get that to work or find documentation that could answer my question.
#!/usr/bin/perl use WWW::Mechanize; #use strict; ### Create the Bot and set the Variables my $mech = WWW::Mechanize->new; my $url = 'http://www.vegasinsider.com/nfl/odds/las-vegas/line-movemen +t/bengals-@-ravens.cfm/date/9-07-08/time/1300#J'; save_file ($url); #### sub save_file { my $mech = WWW::Mechanize->new; $mech->timeout(60); my @game = @_; foreach (@game){ print "$_\n"; $_ =~ m{http://www.vegasinsider.com/(.*?)/odds/(.*?)/line- +movement/(.*?)-@-(.*?).cfm/date/(.*?)/time/}; print "$1 $2 $3 $4 $5\n"; my $filename = 'C:\Documents and Settings\Owner\Desktop\VI + Data\sub.html'; print "Getting $filename\n"; $mech->get( "$_", ":content_file" => $filename ) or die "C +an't get url"; print $mech->status; my $data = $mech->content; print " ", -s $filename, " bytes\n"; print $data; } } ## my $file = 'C:\Documents and Settings\Owner\Desktop\VI Data\ne +w.html'; $mech->timeout(60); $mech->get($url, ":content_file" => $file) or die "Can't get u +rl"; print $mech->status; my $data = $mech->content; #print " ", -s $filename, " bytes\n"; print $data;
In reply to Re^2: Anyone know why I can't scrape this page?
by lv211
in thread Anyone know why I can't scrape this page?
by lv211
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |