in reply to Re: Key/Value pair from GET
in thread Key/Value pair from GET
<a href="thepage.jsp?siteId=1§ionId=443&"> <span class="small">Geography</span></a>,
#!perl use LWP::Simple; use strict; use warnings; #get the values out easily! my %categories = (); my $page = get 'http://www.thepage.com/thepage.html'; while ($page=~m/sectionId\=(\w+?)".+?\"small\">(\w+?)\</sg){ $categories{$1}=$2; print "[$1] and [$2]"; } my @pairlist = keys(%categories); my $idkey = (); foreach $idkey (@pairlist) { print "$idkey,$categories{$idkey}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: better example of what I am trying to do
by Abigail-II (Bishop) on Jun 06, 2002 at 09:55 UTC |