Created
October 27, 2011 14:52
-
-
Save vgoklani/1319760 to your computer and use it in GitHub Desktop.
use BeautifulSoup to extract URLs from an HTML file
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
f = open('filename.txt', 'r') | |
from BeautifulSoup import BeautifulSoup | |
soup = BeautifulSoup(f) | |
for tag in soup.findAll('a', href=True): | |
print tag['href'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment