Added specific searching for the download url of non-full promotions and prices files. Changed return value of get_download_url accordingly.

This commit is contained in:
KorenLazar
2021-08-17 13:06:42 +03:00
parent 3770352d04
commit cffdd84086
4 changed files with 36 additions and 5 deletions

View File

@@ -66,6 +66,8 @@ def get_bs_object_from_link(chain: SupermarketChain, store_id: int, category: Su
"""
session = requests.Session()
download_url: str = chain.get_download_url(store_id, category, session)
if not download_url:
return BeautifulSoup()
response_content = session.get(download_url).content
try:
xml_content: AnyStr = gzip.decompress(response_content)