MCInfo: in 'recipes', use str.lower() before comparing text

This commit is contained in:
James Lu 2016-03-04 16:32:15 -08:00
parent a82a753972
commit ecb313dd1f

View File

@ -211,14 +211,14 @@ class MCInfo(callbacks.Plugin):
# item. # item.
header = '' header = ''
for header in soup.find_all('h3'): for header in soup.find_all('h3'):
if header.span and header.span.get_text().strip() == 'Crafting ingredient': if header.span and header.span.get_text().strip().lower() == 'crafting ingredient':
break break
else: else:
irc.error("No recipes found.", Raise=True) irc.error("No recipes found.", Raise=True)
for tag in header.next_siblings: for tag in header.next_siblings:
# Only look at crafting table UIs after this header. # Only look at crafting table UIs after this header.
if tag.name == 'table' and tag.get("data-description") == 'Crafting recipes': if tag.name == 'table' and tag.get("data-description").lower() == 'crafting recipes':
recipes = [] recipes = []
# Iterate over all the recipes shown and get their names. # Iterate over all the recipes shown and get their names.