From 5bd0654851cd6df06c0d507588a7a11a796d8c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B3nika=20M=C3=A1trai-Pitz?= <57799105+pitzmoni@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:10:34 +0200 Subject: [PATCH] Update utils.py to get comments, retweets and likes --- Scweet/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scweet/utils.py b/Scweet/utils.py index 3048cee..b7057fd 100644 --- a/Scweet/utils.py +++ b/Scweet/utils.py @@ -58,17 +58,17 @@ def get_data(card, save_images=False, save_dir=None): # text = comment + embedded try: - reply_cnt = card.find_element(by=By.XPATH, value='.//div[@data-testid="reply"]').text + reply_cnt = card.find_element(by=By.XPATH, value='.//button[@data-testid="reply"]').text except: reply_cnt = 0 try: - retweet_cnt = card.find_element(by=By.XPATH, value='.//div[@data-testid="retweet"]').text + retweet_cnt = card.find_element(by=By.XPATH, value='.//button[@data-testid="retweet"]').text except: retweet_cnt = 0 try: - like_cnt = card.find_element(by=By.XPATH, value='.//div[@data-testid="like"]').text + like_cnt = card.find_element(by=By.XPATH, value='.//button[@data-testid="like"]').text except: like_cnt = 0