Last active
December 16, 2015 21:39
-
-
Save beaumartinez/5501700 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
from lxml.html import fromstring | |
from requests import get | |
def get_soups(): | |
'''Get today's soups at Pret. | |
Return a list in the format: | |
['Sausage Hot Pot', 'Lentil & Coconut Curry', 'Cream of Mushroom'] | |
''' | |
response = get('http://www.pret.co.uk/todays_soups.htm') | |
page = fromstring(response.text) | |
soups = page.cssselect('div.panel a img') | |
soups = map(lambda soup: soup.attrib['alt'], soups) | |
return soups | |
if __name__ == '__main__': | |
print get_soups() |
THIS IS FOR REAL (how did I not see this comment).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this for real?