has added a CSV format promotions file when running --promos. Item.py was added for moduling.

This commit is contained in:
KorenLazar
2021-01-28 16:25:38 +02:00
parent 47c0d04ce4
commit d7e5b709f8
8 changed files with 94 additions and 29 deletions

View File

@@ -2,6 +2,8 @@ from typing import Dict, List
import requests
from bs4 import BeautifulSoup
from bs4.element import Tag
from item import Item
from supermarket_chain import SupermarketChain
@@ -30,7 +32,7 @@ class ShuferSal(SupermarketChain):
return 'Shufersal'
@staticmethod
def get_items(promo: Tag, items_dict: Dict[str, str]) -> List[str]:
def get_items(promo: Tag, items_dict: Dict[str, Item]) -> List[Item]:
items = list()
for item in promo.find_all('Item'):
item_code = item.find('ItemCode').text