DDG: bugfix

From: ad8931ad73
This commit is contained in:
James Lu 2014-12-14 20:00:43 -08:00 committed by GLolol
parent f627837496
commit be3112197b

View File

@ -76,8 +76,9 @@ class DDG(callbacks.Plugin):
tables = soup.find_all('table') tables = soup.find_all('table')
# Sometimes there is an extra table for page navigation # Sometimes there is an extra table for page navigation
webresults = tables[2].find_all('tr') try:
if not webresults: webresults = tables[2].find_all('tr')
except IndexError:
webresults = tables[1].find_all('tr') webresults = tables[1].find_all('tr')
if webresults: if webresults:
try: try: