From f8bd948b9c4eb9310fd9807d90df039990c62580 Mon Sep 17 00:00:00 2001 From: jeancf Date: Wed, 12 Jul 2023 22:19:04 +0200 Subject: [PATCH] Hit a bump --- twoot.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index ba1601e..56242a9 100755 --- a/twoot.py +++ b/twoot.py @@ -234,7 +234,19 @@ def get_timeline(url): soup = BeautifulSoup(twit_account_page.text, 'html.parser') # Extract twitter timeline - timeline = soup.find_all(has_class_timeline_item_but_not_thread) + timeline = [] + + # Get all the items from the timeline + list = soup.find_all('div', class_='timeline-item') + + for item in list: + classes = item['class'] + if 'more-replies-thread' in classes: + logging.debug('found a more-replies-thread item') + else: + timeline.append(item) + + return soup, timeline