From aaa35f20c28a91c8c49946488e2eed901bcbe2ff Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sun, 10 Apr 2022 22:43:03 +0200 Subject: [PATCH] stop at the end --- steam_chat_logger.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/steam_chat_logger.py b/steam_chat_logger.py index d1931a2..82c38d9 100755 --- a/steam_chat_logger.py +++ b/steam_chat_logger.py @@ -170,9 +170,12 @@ while True: print('getting next page') r = user.session.get(f'https://help.steampowered.com/en/accountdata/AjaxLoadMoreData/?url=GetFriendMessagesLog&continue={continue_value}') continue_value = r.json()['continue'] - html = r.json()['html'] - trs = BeautifulSoup(html, 'html.parser').find_all('tr') - parse_trs(trs) + if continue_value: + html = r.json()['html'] + trs = BeautifulSoup(html, 'html.parser').find_all('tr') + parse_trs(trs) + else: + break # CLOSE