bugfix + postprocessing
This commit is contained in:
@ -80,7 +80,7 @@ def parse_craft_item(container) -> ParsedItem|None:
|
||||
item = CraftItem(output_item_title, output_item_img_url, output_item_img_shift)
|
||||
return ParsedItem(item=item, amount=output_amount)
|
||||
|
||||
def parse_craft_components_and_recipe(container, output_item_name: str, output_count = 1) -> ParsedRecipeInput|None:
|
||||
def parse_craft_components_and_recipe(container : BeautifulSoup, output_item_name: str, output_count = 1) -> ParsedRecipeInput|None:
|
||||
input_span = container.find('span', class_='mcui-input')
|
||||
if(input_span is None):
|
||||
logger.error(f'ошибка для \n{container}\n: не найдено рецепта крафта')
|
||||
@ -98,7 +98,10 @@ def parse_craft_components_and_recipe(container, output_item_name: str, output_c
|
||||
#existing_items = set()
|
||||
|
||||
for input_span_name_container in input_span_name_containers:
|
||||
|
||||
if(input_span_name_container.contents is None or input_span_name_container.contents.__len__() == 0):
|
||||
logger.warning('Пустая ячейка, скипаю')
|
||||
continue
|
||||
|
||||
if(input_span_name_container is None):
|
||||
logger.error('ошибка для набора контейнеров: не найден текстовый контейнер!')
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user