add more testing stuff

This commit is contained in:
Vxrtrauter
2025-10-18 01:08:36 +02:00
parent 5637e80657
commit 1cab671a13
2 changed files with 7 additions and 9 deletions
+6 -5
View File
@@ -12,14 +12,15 @@ def scrape_monkrus_telegram():
print(response.status_code) # rm later print(response.status_code) # rm later
soup = BeautifulSoup(response.text, "html.parser") soup = BeautifulSoup(response.text, "html.parser")
posts = soup.find_all("div", class_=["tgme_widget_message_wrap js-widget_message_wrap", "tgme_widget_message_wrap js-widget_message_wrap date_visible"]) bubbles = soup.find_all("div", class_="tgme_widget_message_bubble")
for post in posts: for bubble in bubbles:
posts_txt = post.find("div", class_="tgme_widget_message_text js-message_text") # this doesnt work post_txt = bubble.find("div", class_="tgme_widget_message_text js-message_text") # this doesnt work
if post_txt.b:
posts.append(Post(text=post_txt.get_text()))
print(post_txt.b.text)
print(posts_txt)
+1 -4
View File
@@ -23,7 +23,4 @@ state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], downloa
@dataclass @dataclass
class Post: class Post:
id: int text: str
title: str
url: str
author: str