From 7682c471be3bdedccf17815b78ac21a2ee5ef347 Mon Sep 17 00:00:00 2001 From: patrickdx Date: Tue, 27 Aug 2024 00:47:22 -0400 Subject: [PATCH] added sources --- finvizfinance/quote.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/finvizfinance/quote.py b/finvizfinance/quote.py index 9a72f0b..d1ffbeb 100644 --- a/finvizfinance/quote.py +++ b/finvizfinance/quote.py @@ -278,7 +278,7 @@ def ticker_news(self): """ fullview_news_outer = self.soup.find("table", class_="fullview-news-outer") rows = fullview_news_outer.find_all("tr") - + frame = [] last_date = "" for row in rows: @@ -287,6 +287,7 @@ def ticker_news(self): news_date = cols[0].text title = cols[1].a.text link = cols[1].a["href"] + source = cols[1].span.text news_time = news_date.split() if len(news_time) == 2: last_date = news_time[0] @@ -296,7 +297,7 @@ def ticker_news(self): news_time = format_datetime(news_time) - info_dict = {"Date": news_time, "Title": title, "Link": link} + info_dict = {"Date": news_time, "Title": title, "Link": link, "Source": source[1:-1]} frame.append(info_dict) except AttributeError: pass