Skip to content

Instantly share code, notes, and snippets.

@starenka
Created August 5, 2011 23:45
Show Gist options
  • Save starenka/1128784 to your computer and use it in GitHub Desktop.
Save starenka/1128784 to your computer and use it in GitHub Desktop.
greps menus of my fav restaurants close to my office
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from pyquery import PyQuery as pq
doc = pq(url='http://www.jinakrajina.cz/cz/poledni-menu')
noms = doc.find('td > p')
print '\n%s'%noms[0].text_content()[2:]
for i,nom in enumerate(noms[1:-1:2],1):
print '[%d] %s'%(i,nom.text_content().strip())
print '\n=====\n'
doc = pq(url='http://www.lemonleaf.cz/lunch_buffet_menu.php')
noms = doc.find('div > dl')[datetime.date.today().weekday()].iterchildren()
for i in noms:
print i.text_content().strip(),noms.next().text_content().strip()
@honzajavorek
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment