diff --git a/Parsing ZARAHOME/src/categories.xlsx b/Parsing ZARAHOME/src/categories.xlsx index 8011008..9eb51c6 100644 Binary files a/Parsing ZARAHOME/src/categories.xlsx and b/Parsing ZARAHOME/src/categories.xlsx differ diff --git a/Parsing ZARAHOME/src/xlsx_recorder.py b/Parsing ZARAHOME/src/xlsx_recorder.py index 54ada90..b40753e 100644 --- a/Parsing ZARAHOME/src/xlsx_recorder.py +++ b/Parsing ZARAHOME/src/xlsx_recorder.py @@ -7,11 +7,15 @@ import re, json, math, logging, requests, os log = logging.getLogger("recorder") # ─────────────────────── настройки ─────────────────────── -SEND_JSON = False # отправка POST -SAVE_JSON = False # сохранять копию JSON +SEND_JSON = False # отправка POST +SAVE_JSON = True # сохранять копию JSON + POST_URL = "http://localhost:3005/parser/data" +MIN_PRICE = 40 # включительно +MAX_PRICE = 1200 # включительно INVALID_CHARS = r'[<>:"/\\|*?]' + def sanitize_filename(name: str, repl: str = "_") -> str: """Удаляет/заменяет символы, запрещённые в именах файлов.""" clean = re.sub(INVALID_CHARS, repl, name) @@ -57,6 +61,11 @@ class Recorder: weight_gram = float(row[idx["Свойство: Вес(г)"]]) if row[idx["Свойство: Вес(г)"]] else 0.0 weight_kg = math.ceil(weight_gram / 1000) if weight_gram else 0 + # --- фильтр по цене --- + if not (MIN_PRICE <= price_int <= MAX_PRICE): + # товар вне диапазона -> отправится только в .xlsx + continue + # составляем объект variant = { "status_id": 1, diff --git a/Parsing ZARAHOME/src/~$categories.xlsx b/Parsing ZARAHOME/src/~$categories.xlsx deleted file mode 100644 index 0f76e2b..0000000 Binary files a/Parsing ZARAHOME/src/~$categories.xlsx and /dev/null differ diff --git a/Парсер_IKEA/~$leaf_categories.xlsx b/Парсер_IKEA/~$leaf_categories.xlsx deleted file mode 100644 index 0f76e2b..0000000 Binary files a/Парсер_IKEA/~$leaf_categories.xlsx and /dev/null differ