Example #1
0
def _raw_meals_generator(tag):  # TODO rework with regexps
    act_tag = tag
    for i in range(4):
        act_tag = _move_to_next_p(act_tag)
        if i == 0:
            yield _get_soup_raw(utils.get_text_rec(act_tag.span))
        else:
            meal_text = act_tag.span.get_text().split()
            alegrens_text = act_tag.span.sub.get_text()

            price_raw = _get_price_raw(meal_text, alegrens_text)  # price can be squished with other text
            meal_raw = _get_meal_raw(meal_text)

            yield meal_raw, price_raw
Example #2
0
def _get_meals_raw(tag):
    return [utils.get_text_rec(td.next_sibling.next_sibling) for td in tag.find_all('h1')]