Created
March 31, 2015 12:31
-
-
Save opexxx/869f102f0af113ba54ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import re | |
#connect to a URL | |
website = urllib2.urlopen("url") | |
#read html code | |
html = website.read() | |
#use re.findall to get all the links | |
links = re.findall('"((http|ftp)s?://.*?)"', html) | |
print links |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment