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) time.sleep(2)
searchElem = driver.find_element(By.CLASS_NAME, "form-control") 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) time.sleep(5)
conns = driver.find_elements(By.CLASS_NAME, "f") conns = driver.find_elements(By.CLASS_NAME, "f")

View File

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