oscar0812 / pyfinviz

A python package to scrape data from finviz.com
Other
40 stars 9 forks source link

Pyfinviz stopped working suddenly. Probably a change on the Finviz site #17

Closed alberto33 closed 1 year ago

alberto33 commented 1 year ago

I thought I had reported this issue but I don't see it in the list of issues. Apologies if it is a repeat.

Suddenly Pyfinviz stopped working probably because of a change in the Finviz layout. This call now fails:

from pyfinviz.quote import Quote
quote = Quote(ticker="AMZN")

With this error:

Traceback (most recent call last):
  File "C:\Users\alber\PycharmProjects\StrategyScanner\strategyscanner\pyfinviz_tester.py", line 26, in <module>
    test2()
  File "C:\Users\alber\PycharmProjects\StrategyScanner\strategyscanner\pyfinviz_tester.py", line 10, in test2
    quote = Quote(ticker="AMZN")
  File "C:\Users\alber\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfinviz\quote.py", line 134, in __init__
    self.outer_news_df = Quote.__get_outer_news_df__(self.soup)
  File "C:\Users\alber\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfinviz\quote.py", line 50, in __get_outer_news_df__
    date_ = prev_date.split(' ')[0] + ' ' + date_
AttributeError: 'NoneType' object has no attribute 'split'

I fixed it by commenting out this line on quote.py (not an ideal fix)

# self.outer_news_df = Quote.__get_outer_news_df__(self.soup)

oscar0812 commented 1 year ago

On it, some date wording changed on the Finviz site

oscar0812 commented 1 year ago

Issue is fixed. Please update to the latest version and confirm: pip install pyfinviz==0.14 I will close this issue once I receive confirmation. Thanks!

alberto33 commented 1 year ago

Thank you for the update

On Wed, Sep 20, 2023, 7:44 PM Oscar @.***> wrote:

Issue is fixed. Please update to the latest version and confirm: pip install pyfinviz==0.14 I will close this issue once I receive confirmation. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/oscar0812/pyfinviz/issues/17#issuecomment-1728561986, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYGAABEOKSKDZKFPLA43VTX3N5WBANCNFSM6AAAAAA4RTBPIY . You are receiving this because you authored the thread.Message ID: @.***>

oscar0812 commented 1 year ago

Thank you for the update

On Wed, Sep 20, 2023, 7:44 PM Oscar @.***> wrote:

Issue is fixed. Please update to the latest version and confirm: pip install pyfinviz==0.14 I will close this issue once I receive confirmation. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/oscar0812/pyfinviz/issues/17#issuecomment-1728561986, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYGAABEOKSKDZKFPLA43VTX3N5WBANCNFSM6AAAAAA4RTBPIY . You are receiving this because you authored the thread.Message ID: @.***>

Let me know if the issue is fixed.

alberto33 commented 1 year ago

Confirming that version 0.14 works like a charm.