Skip to content

Instantly share code, notes, and snippets.

@d-srd
Created October 5, 2018 08:52
Show Gist options
  • Save d-srd/070697100242d1e45f9941e7d2462be0 to your computer and use it in GitHub Desktop.
Save d-srd/070697100242d1e45f9941e7d2462be0 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
base_url = 'http://www.sczg.unizg.hr/prehrana/restorani/savska/'
req = requests.get(base_url, headers={'User-Agent': 'Mozilla Firefox'})
content = req.content
page = BeautifulSoup(content, 'html.parser')
jelovnik = page.find_all('div', attrs={'class': 'content'})[1]
print(jelovnik)
# CAVEATS: you must have GNU tools and elinks installed
function menza() {
python3 ~/Developer/scripts/menza.py | awk '/JELOVNIK/,EOF' | ghead -n -1 | elinks --dump
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment