views:

34

answers:

1

how to extract links using lynx the links form anchor tags if there is a link in web i need to extract google.com

+1  A: 
lynx -dump -listonly "http://site.com"

Or

lynx -source "www.site.com" | awk -vRS="</a>" '{ gsub(/.*a[ ]+href=\042*|\042.*/,"");print }'
ghostdog74
ya i tested it but it seems it gives like reference1)some links....i need only the links i am using an command lynx -dump -listonly $i | grep -o "http.*" but it takes all links i need the links only from anchor tag
Ramesh
lynx -dump -listonly http:/www.sample.com | grep -o "http.*" this gives the same
Ramesh