handle invalid search terms
This commit is contained in:
parent
450c681fab
commit
746146edb4
|
@ -73,6 +73,10 @@ def metacritic(inp):
|
||||||
if not doc.find_class('query_results'):
|
if not doc.find_class('query_results'):
|
||||||
return 'no results found'
|
return 'no results found'
|
||||||
|
|
||||||
|
# if they specified an invalid search term, the input box will be empty
|
||||||
|
if doc.get_element_by_id('search_term').value == '':
|
||||||
|
return 'invalid search term'
|
||||||
|
|
||||||
if plat not in game_platforms:
|
if plat not in game_platforms:
|
||||||
# for [all] results, or non-game platforms, get the first result
|
# for [all] results, or non-game platforms, get the first result
|
||||||
result = doc.find_class('result first_result')[0]
|
result = doc.find_class('result first_result')[0]
|
||||||
|
|
Loading…
Reference in New Issue