IGN: Nytimes recipe now throws a useful error when login fails

This commit is contained in:
Kovid Goyal 2009-11-14 11:20:38 -07:00
parent 30e0be1170
commit 799fb6645b

View File

@ -35,7 +35,10 @@ class NYTimes(BasicNewsRecipe):
br.select_form(name='login')
br['USERID'] = self.username
br['PASSWORD'] = self.password
br.submit()
raw = br.submit().read()
if 'Sorry, we could not find the combination you entered. Please try again.' in raw:
raise Exception('Your username and password are incorrect')
#open('/t/log.html', 'wb').write(raw)
return br
def parse_index(self):