Log failed login URL

This commit is contained in:
Kovid Goyal 2017-07-11 23:22:30 +05:30
parent f24541f37a
commit 6e02b9f8c1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -147,7 +147,11 @@ class WSJ(BasicNewsRecipe):
raise ValueError(
'Failed to login (XHR failed), check username and password')
br.set_cookie('m', data['username'], '.wsj.com')
try:
r = br.open(data['url'])
except Exception:
self.log.error('Failed to open login url: {}'.format(data['url']))
raise
self.wsj_itp_page = raw = r.read()
if b'>Sign Out<' not in raw:
raise ValueError(