AlwaysSurprised has asked for the wisdom of the Perl Monks concerning the following question:
"I'll give you 10000 contiguous pages from Argos. You tell me the sum of the products" was the jist of the conversation.
Ok honoured Monks. I confess I haven't programmed in perl since the last century and things have moved one. Quills are no longer needed in my editor of choice.
So my thinking has been
my $req = HTTP::Request->new(GET => $targetURL); my $res = $ua->request($req);
to snort the response code, if it's a 200, then
my $website_content = get($targetURL);and regex the info out of the page I'm after and add it to a file.
Did it, but it's taking about a minute to process 100 pages.
Oh wise ones, point out the errors in my thinking. I'm on a fast connection. Is that the bottle neck? Can I get it going significantly faster?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Speeding things up
by huck (Prior) on Apr 15, 2018 at 01:30 UTC | |
by Anonymous Monk on Apr 15, 2018 at 10:06 UTC | |
|
Re: Speeding things up
by marto (Cardinal) on Apr 15, 2018 at 09:12 UTC | |
by Anonymous Monk on Apr 15, 2018 at 13:14 UTC | |
by marto (Cardinal) on Apr 15, 2018 at 13:34 UTC | |
|
Re: Speeding things up -- LWP::Parallel
by Discipulus (Canon) on Apr 15, 2018 at 16:31 UTC | |
by marioroy (Prior) on Apr 29, 2018 at 10:43 UTC | |
by AlwaysSurprised (Novice) on Apr 15, 2018 at 21:59 UTC | |
by mr_ron (Deacon) on Apr 30, 2018 at 00:48 UTC | |
by AlwaysSurprised (Novice) on Jun 16, 2018 at 23:54 UTC | |
by hippo (Archbishop) on Jun 17, 2018 at 09:35 UTC | |
|
Re: Speeding things up
by karlgoethebier (Abbot) on Apr 16, 2018 at 11:46 UTC |