Created
December 17, 2013 10:40
-
-
Save flyte/8003007 to your computer and use it in GitHub Desktop.
Get text from First Capital Connect major disruption website
This file contains hidden or 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
from mechanize import Browser | |
from BeautifulSoup import BeautifulSoup | |
if __name__ == "__main__": | |
br = Browser() | |
page = br.open("http://www.firstcapitalconnect.co.uk/plan-your-journey/major-disruption/") | |
soup = BeautifulSoup(page.get_data()) | |
s = soup.find("div", {"class": "single-container"}) | |
lines = s.findAll("span") | |
text = "" | |
for l in lines: | |
text += "%s\n" % l.text | |
print text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment