Prints a list of all links in a specified webpage
6
Builds and prints a list of all links in a specified webpage
"""
Description: prints a list of all links in a webpage
URL:http://sebsauvage.net/index.html
License: Unspecified/Public Domain
"""
import re, urllib
htmlSource = urllib.urlopen("http://sebsauvage.net/index.html").read(200000)
linksList = re.findall('<a href=(.*?)>.*?</a>',htmlSource)
for link in linksList:
print link






htmlSource = urllib.urlopen("http://www.python.org/index.html").readlines()
....
linksList = re.findall('<a href=(.*?)>.*?</a>',repr(htmlSource))