Simple Python Program to Extract links from Web Page

Simple Python Program to Extract links from Web Page #Author Kumar Shubham # http://hackaholic.info # This program will extract all the links from a webpage import sys import urllib2 import re def find_link(url): sys.stdout.write(“Wait a Minute its retrieving.”) try: if url[0:4]!=”http”: url=”http://” + url f=(urllib2.urlopen(url)).read() k=re.findall(‘(src|href)=”(\S+)”‘,f) k=set(k) print “The Links[…] Continue reading