OpenBB-finance / OpenBB

Investment Research for Everyone, Everywhere.
https://openbb.co
Other
31.37k stars 2.88k forks source link

[Bug] Stocks > DD > Finviz News #1006

Closed Chavithra closed 2 years ago

Chavithra commented 2 years ago

Describe the bug The following function is broken and unused :

Since this news function is unused maybe :

To Reproduce Here is the code to reproduce the issue :

from gamestonk_terminal.stocks.due_diligence import finviz_model, finviz_view

finviz_view.news(ticker="TSLA", num=5)

Screenshots Here is the error :

...gamestonk_terminal\stocks\due_diligence\finviz_view.py in news(ticker, num)
     45     d_finviz_news = finviz_model.get_news(ticker)
     46     i = 0
---> 47     for s_news_title, s_news_link in {*d_finviz_news}:
     48         print(f"-> {s_news_title}")
     49         print(f"{s_news_link}\n")

ValueError: too many values to unpack (expected 2)

Desktop (please complete the following information):

Additional context One solution would be to replace this line :

for s_news_title, s_news_link in {*d_finviz_news}:

By this line :

for s_news_title, s_news_link, *_ in d_finviz_news:
DidierRLopes commented 2 years ago

Fixed!