Make logout link detection a bit more robust

Also fix typo in wsj_free recipe, it should match wsj
This commit is contained in:
Kovid Goyal 2019-09-18 09:44:50 +05:30
parent 94c6624958
commit 7f165f6735
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@ class WSJ(BasicNewsRecipe):
self.log('Performing login callback...') self.log('Performing login callback...')
res = br.submit() res = br.submit()
self.wsj_itp_page = raw = res.read() self.wsj_itp_page = raw = res.read()
if b'logout' not in raw: if b'/logout' not in raw:
raise ValueError( raise ValueError(
'Failed to login (callback URL failed), check username and password') 'Failed to login (callback URL failed), check username and password')
return br return br

View File

@ -148,7 +148,7 @@ class WSJ(BasicNewsRecipe):
self.log('Performing login callback...') self.log('Performing login callback...')
res = br.submit() res = br.submit()
self.wsj_itp_page = raw = res.read() self.wsj_itp_page = raw = res.read()
if b'>logout<' not in raw: if b'/logout' not in raw:
raise ValueError( raise ValueError(
'Failed to login (callback URL failed), check username and password') 'Failed to login (callback URL failed), check username and password')
return br return br