Check for successful login in WSJ recipe

This commit is contained in:
Kovid Goyal 2010-02-20 13:13:18 -07:00
parent dd0905ad3f
commit ce5c3e3951

View File

@ -50,7 +50,11 @@ class WallStreetJournal(BasicNewsRecipe):
br.select_form(nr=0) br.select_form(nr=0)
br['user'] = self.username br['user'] = self.username
br['password'] = self.password br['password'] = self.password
br.submit() res = br.submit()
raw = res.read()
if 'Welcome,' not in raw:
raise ValueError('Failed to log in to wsj.com, check your '
'username and password')
return br return br
def postprocess_html(self, soup, first): def postprocess_html(self, soup, first):