Prints a list of all links in a specified webpage





6
Date Submitted Fri. Aug. 18th, 2006 11:10 AM
Revision 1 of 1
Scripter ASmith
Tags python
Comments 4 comments
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
 

Comments

Comments This does not always work
Fri. Aug. 18th, 2006 11:56 AM    Helper lgrover
Comments .read(200000)
Sun. Oct. 29th, 2006 1:15 AM    Newbie dmitry
  Comments my changes
Sun. Oct. 29th, 2006 4:24 AM    Newbie dmitry
Comments Reinventing the wheel!
Thu. Nov. 2nd, 2006 4:18 PM    Newbie anthony

Voting