Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get all links in a web page (1)
- ... or regular expression marvels.
- import re, urllib
- htmlSource = urllib.urlopen("http://learn.pythonanywhere.com").read(200000)
- linksList = re.findall('<a href=(.*?)>.*?</a>',htmlSource)
- for link in linksList:
- print link
Advertisement
Add Comment
Please, Sign In to add comment