finished implementing exporting promotion to xlsx table and automatically opening the xlsx file

This commit is contained in:
KorenLazar
2021-06-01 21:00:40 +03:00
parent ec505dba67
commit 27b45a4999
8 changed files with 152 additions and 50 deletions

View File

@@ -1,9 +1,11 @@
import logging
from utils import xml_file_gen, create_bs_object
from supermarket_chain import SupermarketChain
from bs4 import BeautifulSoup
def print_stores_ids(city: str, load_xml: bool, chain: SupermarketChain):
def log_stores_ids(city: str, load_xml: bool, chain: SupermarketChain):
"""
This function prints the stores IDs of stores in a given city.
The city must match its spelling in Shufersal's website (hence it should be in Hebrew).
@@ -17,7 +19,7 @@ def print_stores_ids(city: str, load_xml: bool, chain: SupermarketChain):
for store in bs_stores.find_all("STORE"):
if store.find("CITY").text == city:
print((store.find("ADDRESS").text, store.find("STOREID").text, store.find("SUBCHAINNAME").text))
logging.info((store.find("ADDRESS").text, store.find("STOREID").text, store.find("SUBCHAINNAME").text))
def get_all_deals(chain):