Created
July 5, 2011 19:49
-
-
Save acrymble/1065730 to your computer and use it in GitHub Desktop.
Python Webpage to Text
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
# Given a URL, return string of lowercase text from page. | |
def webPageToText(url): | |
import urllib2 | |
response = urllib2.urlopen(url) | |
html = response.read() | |
text = stripTags(html).lower() | |
return text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment