Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -365,13 +365,13 @@ def fetch_articles_from_page(url):
|
|
365 |
response = requests.get(url)
|
366 |
response.raise_for_status()
|
367 |
soup = BeautifulSoup(response.content, 'html.parser')
|
368 |
-
articles = soup.find_all('div', class_='
|
369 |
return articles, soup
|
370 |
|
371 |
def extract_articles(articles):
|
372 |
article_data = []
|
373 |
for article in articles:
|
374 |
-
title_div = article.find('
|
375 |
title = title_div.get_text(strip=True) if title_div else "No Title"
|
376 |
date_div = article.find('div', class_='entry-date gt-meta')
|
377 |
date = date_div.get_text(strip=True) if date_div else "No Date"
|
@@ -382,7 +382,7 @@ def extract_articles(articles):
|
|
382 |
article_response = requests.get(link)
|
383 |
article_response.raise_for_status()
|
384 |
article_soup = BeautifulSoup(article_response.content, 'html.parser')
|
385 |
-
article_content_div = article_soup.find('div', class_='entry-
|
386 |
article_content = article_content_div.get_text(strip=True) if article_content_div else "No content found"
|
387 |
article_data.append({
|
388 |
'title': title,
|
@@ -423,7 +423,7 @@ def extract_articles(articles):
|
|
423 |
})
|
424 |
return article_data
|
425 |
|
426 |
-
def fetch_golomt_bank_news(num_results=
|
427 |
base_url = "https://golomtbank.com/en/investor-relations"
|
428 |
current_page_url = base_url
|
429 |
all_articles = []
|
|
|
365 |
response = requests.get(url)
|
366 |
response.raise_for_status()
|
367 |
soup = BeautifulSoup(response.content, 'html.parser')
|
368 |
+
articles = soup.find_all('div', class_='entry-post gt-box-shadow-2')
|
369 |
return articles, soup
|
370 |
|
371 |
def extract_articles(articles):
|
372 |
article_data = []
|
373 |
for article in articles:
|
374 |
+
title_div = article.find('h2', class_='entry-title')
|
375 |
title = title_div.get_text(strip=True) if title_div else "No Title"
|
376 |
date_div = article.find('div', class_='entry-date gt-meta')
|
377 |
date = date_div.get_text(strip=True) if date_div else "No Date"
|
|
|
382 |
article_response = requests.get(link)
|
383 |
article_response.raise_for_status()
|
384 |
article_soup = BeautifulSoup(article_response.content, 'html.parser')
|
385 |
+
article_content_div = article_soup.find('div', class_='entry-content')
|
386 |
article_content = article_content_div.get_text(strip=True) if article_content_div else "No content found"
|
387 |
article_data.append({
|
388 |
'title': title,
|
|
|
423 |
})
|
424 |
return article_data
|
425 |
|
426 |
+
def fetch_golomt_bank_news(num_results=20):
|
427 |
base_url = "https://golomtbank.com/en/investor-relations"
|
428 |
current_page_url = base_url
|
429 |
all_articles = []
|