catch the right exception

This commit is contained in:
Romain Bignon 2013-01-08 23:09:24 +01:00
commit d0b546cc15

View file

@ -34,7 +34,7 @@ class UnavailablePage(BasePage):
def on_loaded(self):
try:
a = self.document.xpath('//a[@class="btn"]')[0]
except KeyError:
except IndexError:
raise BrowserUnavailable()
else:
self.browser.location(a.attrib['href'])