mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 17:59:43 +02:00
add more testing stuff
This commit is contained in:
@@ -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)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user