catch the right exception
This commit is contained in:
parent
fe8374e671
commit
d0b546cc15
1 changed files with 1 additions and 1 deletions
|
|
@ -34,7 +34,7 @@ class UnavailablePage(BasePage):
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
try:
|
try:
|
||||||
a = self.document.xpath('//a[@class="btn"]')[0]
|
a = self.document.xpath('//a[@class="btn"]')[0]
|
||||||
except KeyError:
|
except IndexError:
|
||||||
raise BrowserUnavailable()
|
raise BrowserUnavailable()
|
||||||
else:
|
else:
|
||||||
self.browser.location(a.attrib['href'])
|
self.browser.location(a.attrib['href'])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue