#!/usr/bin/env python3
# coding=utf-8
import requests, sys, re
from datetime import datetime
from bs4 import BeautifulSoup

def get_url():
    return "http://www.momentodelta.cz/"

def get_name():
    return "Momento Delta"

def get_file():
    kantyna = requests.get(get_url())
    kantyna.encoding = 'UTF-8'
    return kantyna

def prepare_bs(kantyna):
    if kantyna is not None and kantyna.status_code == 200:
        html = kantyna.text
        soup = BeautifulSoup(html, 'html.parser')
        return soup

    else:
        return "Error"

def return_menu(soup):

    a = soup.find("div", { "class": "grid-3 table-den show" })
    # print(a)
    date = a.find_all("table")[0].b.text
    b = a.find_all("table")[1].find_all("tr")
    items = []
    for item in b:
        grid = item.find_all("td")
        jidlo = grid[2].text.strip()
        cena = grid[3].text.strip() + " Kč"
        if jidlo is not None and cena is not None and jidlo:
            arr = [jidlo, cena]
            items.append(arr)
        else:
            continue

    return(items, date)


def result():
    try:
        file = get_file()

        bs = prepare_bs(file)

        nazev = get_name()
        url = get_url()
        lokalita = "brumlovka"

        menu_list, date = return_menu(bs)

        return (nazev, url, date, menu_list, lokalita)
    except Exception as e:
        print(e)
        nazev = get_name()
        url = get_url()
        lokalita = "brumlovka"
        return (nazev, url, "Menu nenalezeno", [], lokalita)

if __name__ == "__main__":
    file = get_file()

    bs = prepare_bs(file)

    menu_list, date = return_menu(bs)
    print (date, menu_list)

dc4667b0c11c3f7e4c97a20896678d7d566861ce
<mask token>


def get_url():
    return 'http://www.momentodelta.cz/'


<mask token>


def get_file():
    kantyna = requests.get(get_url())
    kantyna.encoding = 'UTF-8'
    return kantyna


<mask token>


def return_menu(soup):
    a = soup.find('div', {'class': 'grid-3 table-den show'})
    date = a.find_all('table')[0].b.text
    b = a.find_all('table')[1].find_all('tr')
    items = []
    for item in b:
        grid = item.find_all('td')
        jidlo = grid[2].text.strip()
        cena = grid[3].text.strip() + ' Kč'
        if jidlo is not None and cena is not None and jidlo:
            arr = [jidlo, cena]
            items.append(arr)
        else:
            continue
    return items, date


def result():
    try:
        file = get_file()
        bs = prepare_bs(file)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        menu_list, date = return_menu(bs)
        return nazev, url, date, menu_list, lokalita
    except Exception as e:
        print(e)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        return nazev, url, 'Menu nenalezeno', [], lokalita


<mask token>

<mask token>


def get_url():
    return 'http://www.momentodelta.cz/'


<mask token>


def get_file():
    kantyna = requests.get(get_url())
    kantyna.encoding = 'UTF-8'
    return kantyna


def prepare_bs(kantyna):
    if kantyna is not None and kantyna.status_code == 200:
        html = kantyna.text
        soup = BeautifulSoup(html, 'html.parser')
        return soup
    else:
        return 'Error'


def return_menu(soup):
    a = soup.find('div', {'class': 'grid-3 table-den show'})
    date = a.find_all('table')[0].b.text
    b = a.find_all('table')[1].find_all('tr')
    items = []
    for item in b:
        grid = item.find_all('td')
        jidlo = grid[2].text.strip()
        cena = grid[3].text.strip() + ' Kč'
        if jidlo is not None and cena is not None and jidlo:
            arr = [jidlo, cena]
            items.append(arr)
        else:
            continue
    return items, date


def result():
    try:
        file = get_file()
        bs = prepare_bs(file)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        menu_list, date = return_menu(bs)
        return nazev, url, date, menu_list, lokalita
    except Exception as e:
        print(e)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        return nazev, url, 'Menu nenalezeno', [], lokalita


<mask token>

<mask token>


def get_url():
    return 'http://www.momentodelta.cz/'


def get_name():
    return 'Momento Delta'


def get_file():
    kantyna = requests.get(get_url())
    kantyna.encoding = 'UTF-8'
    return kantyna


def prepare_bs(kantyna):
    if kantyna is not None and kantyna.status_code == 200:
        html = kantyna.text
        soup = BeautifulSoup(html, 'html.parser')
        return soup
    else:
        return 'Error'


def return_menu(soup):
    a = soup.find('div', {'class': 'grid-3 table-den show'})
    date = a.find_all('table')[0].b.text
    b = a.find_all('table')[1].find_all('tr')
    items = []
    for item in b:
        grid = item.find_all('td')
        jidlo = grid[2].text.strip()
        cena = grid[3].text.strip() + ' Kč'
        if jidlo is not None and cena is not None and jidlo:
            arr = [jidlo, cena]
            items.append(arr)
        else:
            continue
    return items, date


def result():
    try:
        file = get_file()
        bs = prepare_bs(file)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        menu_list, date = return_menu(bs)
        return nazev, url, date, menu_list, lokalita
    except Exception as e:
        print(e)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        return nazev, url, 'Menu nenalezeno', [], lokalita


if __name__ == '__main__':
    file = get_file()
    bs = prepare_bs(file)
    menu_list, date = return_menu(bs)
    print(date, menu_list)

import requests, sys, re
from datetime import datetime
from bs4 import BeautifulSoup


def get_url():
    return 'http://www.momentodelta.cz/'


def get_name():
    return 'Momento Delta'


def get_file():
    kantyna = requests.get(get_url())
    kantyna.encoding = 'UTF-8'
    return kantyna


def prepare_bs(kantyna):
    if kantyna is not None and kantyna.status_code == 200:
        html = kantyna.text
        soup = BeautifulSoup(html, 'html.parser')
        return soup
    else:
        return 'Error'


def return_menu(soup):
    a = soup.find('div', {'class': 'grid-3 table-den show'})
    date = a.find_all('table')[0].b.text
    b = a.find_all('table')[1].find_all('tr')
    items = []
    for item in b:
        grid = item.find_all('td')
        jidlo = grid[2].text.strip()
        cena = grid[3].text.strip() + ' Kč'
        if jidlo is not None and cena is not None and jidlo:
            arr = [jidlo, cena]
            items.append(arr)
        else:
            continue
    return items, date


def result():
    try:
        file = get_file()
        bs = prepare_bs(file)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        menu_list, date = return_menu(bs)
        return nazev, url, date, menu_list, lokalita
    except Exception as e:
        print(e)
        nazev = get_name()
        url = get_url()
        lokalita = 'brumlovka'
        return nazev, url, 'Menu nenalezeno', [], lokalita


if __name__ == '__main__':
    file = get_file()
    bs = prepare_bs(file)
    menu_list, date = return_menu(bs)
    print(date, menu_list)

#!/usr/bin/env python3
# coding=utf-8
import requests, sys, re
from datetime import datetime
from bs4 import BeautifulSoup

def get_url():
    return "http://www.momentodelta.cz/"

def get_name():
    return "Momento Delta"

def get_file():
    kantyna = requests.get(get_url())
    kantyna.encoding = 'UTF-8'
    return kantyna

def prepare_bs(kantyna):
    if kantyna is not None and kantyna.status_code == 200:
        html = kantyna.text
        soup = BeautifulSoup(html, 'html.parser')
        return soup

    else:
        return "Error"

def return_menu(soup):

    a = soup.find("div", { "class": "grid-3 table-den show" })
    # print(a)
    date = a.find_all("table")[0].b.text
    b = a.find_all("table")[1].find_all("tr")
    items = []
    for item in b:
        grid = item.find_all("td")
        jidlo = grid[2].text.strip()
        cena = grid[3].text.strip() + " Kč"
        if jidlo is not None and cena is not None and jidlo:
            arr = [jidlo, cena]
            items.append(arr)
        else:
            continue

    return(items, date)


def result():
    try:
        file = get_file()

        bs = prepare_bs(file)

        nazev = get_name()
        url = get_url()
        lokalita = "brumlovka"

        menu_list, date = return_menu(bs)

        return (nazev, url, date, menu_list, lokalita)
    except Exception as e:
        print(e)
        nazev = get_name()
        url = get_url()
        lokalita = "brumlovka"
        return (nazev, url, "Menu nenalezeno", [], lokalita)

if __name__ == "__main__":
    file = get_file()

    bs = prepare_bs(file)

    menu_list, date = return_menu(bs)
    print (date, menu_list)
