From 19ae9f5cbeaa5f0acbf73f02ed005d156b351301 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 11 Nov 2019 12:34:28 -0800 Subject: [PATCH] MCWiki: fix crafting table parsing --- MCInfo/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MCInfo/plugin.py b/MCInfo/plugin.py index 2235743..fc86721 100644 --- a/MCInfo/plugin.py +++ b/MCInfo/plugin.py @@ -127,7 +127,7 @@ class MCInfo(callbacks.Plugin): maxitemlength = 0 # Now, parse the layout of the 3x3 crafting grid the wiki shows for items. - for rowdata in crafting_data.div.span.span.children: + for rowdata in crafting_data.find_all('span', class_='mcui-row'): rowitems = [] # Iterate over the rows of the crafting grid, and then the items in each. for itemslot in rowdata.children: @@ -146,7 +146,7 @@ class MCInfo(callbacks.Plugin): maxitemlength = len(itemname) rowitems.append(itemname) - elif itemslot.find('br'): + elif not itemslot.find('invslot-item'): # Empty square. rowitems.append('') if rowitems: