Fixed bug with Shufersal Scraping by changing xml files category back to normal Enum.

This commit is contained in:
korenlazar
2022-10-04 12:09:42 +03:00
parent 7b63eab7bd
commit b1737839ce
2 changed files with 4 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ class CerberusWebClient(SupermarketChain):
time.sleep(2)
searchElem = driver.find_element(By.CLASS_NAME, "form-control")
searchElem.send_keys(category.value)
searchElem.send_keys(category.value.lower().replace('s', ''))
time.sleep(5)
conns = driver.find_elements(By.CLASS_NAME, "f")

View File

@@ -3,7 +3,7 @@ from argparse import ArgumentTypeError
from typing import Dict, List
import requests
from aenum import StrEnum
from aenum import Enum
from bs4.element import Tag
from item import Item
@@ -19,17 +19,12 @@ class SupermarketChain(object, metaclass=Meta):
A class representing a supermarket chain.
"""
class XMLFilesCategory(StrEnum):
class XMLFilesCategory(Enum):
"""
An enum class of different XML files produced by a supermarket chain
"""
All = ("All",)
Prices = ("price",)
PricesFull = ("pricefull",)
Promos = ("promo",)
PromosFull = ("promofull",)
Stores = "store"
All, Prices, PricesFull, Promos, PromosFull, Stores = range(6)
_promotion_tag_name = "Promotion"
_promotion_update_tag_name = "PromotionUpdateDate"