Skip to content
Snippets Groups Projects
Commit 2ebabb65 authored by Jouni Haltta's avatar Jouni Haltta
Browse files

Muille jakoon

parents
Branches master
No related tags found
No related merge requests found
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Macciavelli-lounas
import requests
from bs4 import BeautifulSoup
import lxml
import datetime
import sys
day_shift = int(sys.argv[1]) if len(sys.argv)>1 else 0
result = requests.get('http://www.unica.fi/fi/ravintolat/macciavelli/')
soup = BeautifulSoup(result.content, 'lxml')
try:
current_day = soup.find('h4', {'data-dayofweek':datetime.datetime.today().weekday()+day_shift}).parent
for lunch in current_day.find_all('td', class_='lunch'):
print(" * %s") % (lunch.text)
except AttributeError:
print("Not found")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment