Skip to content

Commit

Permalink
added sources
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdx authored Aug 27, 2024
1 parent bad7716 commit 7682c47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions finvizfinance/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]
Expand All @@ -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
Expand Down

0 comments on commit 7682c47

Please sign in to comment.