Sunday, 15 June 2014

perl - regex to extract url from google search -



perl - regex to extract url from google search -

i need extract url google search , seek this:

if($google =~ /<h3 class="r"><a href="(.*)"/i){ print "$1\n$2\n$3\n$4\n$5\n$6\n$7\n$8\n$9\n$10"; }

but wrong , please help me ;-)

while($google =~ /<h3 class="r"><a href="(.*?)"/ig) { print "$1\n"; }

notice need set ~//g (global search) going next mach in while loop. utilize (.*?) instead of (.*), otherway have in $1 whole page till lastly quote @ page

regex perl url html-parsing

No comments:

Post a Comment