Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanksuse warnings; use strict; use Win32::IE::Mechanize; my $ie; my $id = ' 14632'; my $max_page = 9; $ie = Win32::IE::Mechanize->new( visible => 0 ); my $url = 'http://myspace.com/Modules/ViewFriends/FriendsView.aspx?%3f +fuseacion=user.viewfriends&friendID=' . $id; $ie->get( $url ); sleep 1; my $count = 0; my $i = 0; for (1..$max_page) { scrape_page($_, $max_page); } sub scrape_page { my ($page, $max) = @_; print "Looking at $page ...\n"; if ($page > 1 ) { $ie->follow_link( url => 'javascript:__doPostBack(\'ctl00$cpMain$p +agerBottom\',\'' . $page . '\')' ); } sleep 1; my @data = split(/\n/, $ie->content()); foreach (@data) { chomp; if (/<A href=\"http:\/\/profile\.myspace\.com\/index\.cfm\?fuseact +ion=user.viewprofile&friendid=(.*?)\">(.*?)<\/A><BR>/i) { print "ID: $1\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mechanize, Using WWW instead of IE
by Cody Pendant (Prior) on Jan 28, 2007 at 09:06 UTC | |
|
Re: Mechanize, Using WWW instead of IE
by dorko (Prior) on Jan 28, 2007 at 05:21 UTC | |
by bart (Canon) on Jan 29, 2007 at 12:09 UTC | |
|
Re: Mechanize, Using WWW instead of IE
by andyford (Curate) on Jan 28, 2007 at 12:19 UTC | |
|
Re: Mechanize, Using WWW instead of IE
by mkirank (Chaplain) on Jan 28, 2007 at 15:50 UTC | |
by andyford (Curate) on Jan 29, 2007 at 00:35 UTC | |
by mkirank (Chaplain) on Jan 30, 2007 at 02:26 UTC |