From 4577e9df9ae1a54586417fad799335eae1716f49 Mon Sep 17 00:00:00 2001 From: Ricter Z Date: Sat, 11 Aug 2018 09:24:16 +0800 Subject: [PATCH] fix --- nhentai/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nhentai/parser.py b/nhentai/parser.py index f405f7b..d01a7e1 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -27,7 +27,7 @@ def login_parser(username, password): s.get(constant.LOGIN_URL) content = s.get(constant.LOGIN_URL).content - html = BeautifulSoup(content, 'html.parser').encode("ascii") + html = BeautifulSoup(content, 'html.parser') csrf_token_elem = html.find('input', attrs={'name': 'csrfmiddlewaretoken'}) if not csrf_token_elem: @@ -44,7 +44,7 @@ def login_parser(username, password): logger.error('Login failed, please check your username and password') exit(1) - html = BeautifulSoup(s.get(constant.FAV_URL).content, 'html.parser').encode("ascii") + html = BeautifulSoup(s.get(constant.FAV_URL).content, 'html.parser') count = html.find('span', attrs={'class': 'count'}) if not count: logger.error('Cannot get count of your favorites, maybe login failed.')