minor changes

This commit is contained in:
KorenLazar
2021-02-06 22:53:18 +02:00
parent 18f3fa32b9
commit 67bff9fa76
20 changed files with 44 additions and 46 deletions

18
chains/shufersal.py Normal file
View File

@@ -0,0 +1,18 @@
import requests
from bs4 import BeautifulSoup
from supermarket_chain import SupermarketChain
class ShuferSal(SupermarketChain):
@staticmethod
def get_download_url(store_id: int, category: SupermarketChain.XMLFilesCategory, session: requests.Session) -> str:
url = f"http://prices.shufersal.co.il/FileObject/UpdateCategory?catID={category.value}"
if SupermarketChain.is_valid_store_id(int(store_id)):
url += f"&storeId={store_id}"
req_res: requests.Response = requests.get(url)
soup: BeautifulSoup = BeautifulSoup(req_res.text, features='lxml')
down_url: str = soup.find('a', text="לחץ להורדה")['href']
print(down_url)
return down_url