Hotfix for multiple <B> tags in titles.

This commit is contained in:
A. Svensson 2015-05-19 21:04:45 +02:00
parent f54ca6a171
commit de942345a8

View File

@ -132,8 +132,15 @@ class ServerScraper(object):
# server title), we give them The Boot. # server title), we give them The Boot.
return return
# HACK: In case the server title is encased in extra <B> tags,
# simply grab the second matching tag and use only that as title
# TODO: What if there's multiple <B> tags all over the data?
tmp = data.find('b')
if tmp.find_all('b'):
tmp = tmp.find('b')
try: try:
title = data.find('b').get_text().splitlines()[0].strip().encode('utf-8') title = tmp.get_text().splitlines()[0].strip().encode('utf-8')
except AttributeError: except AttributeError:
# HACK: I think this happends because the raw data was incomplete. # HACK: I think this happends because the raw data was incomplete.
# No complete data, no server update. # No complete data, no server update.