Code Monkey home page Code Monkey logo

Comments (2)

TermoK avatar TermoK commented on August 21, 2024

I have the same issue. The script is going through all pages which get "created" due to the filters but there're no stocks in the stock list. I used the following script:

from finviz.screener import Screener # type: ignore
from requests import get
import json

l_filters = ['geo_usa', 'sh_price_o1']  # Shows companies in NASDAQ which are in the S&P500 # Filter for testing
#l_filters = ['geo_usa', 'ind_stocksonly', 'ta_pattern_horizontal2', 'sh_price_o1'] # Original filter settings
l_stock_list = Screener(filters=l_filters, table='Performance', order='price')

print(len(l_stock_list))
breakpoint()

for stock in l_stock_list:
    print(stock)
breakpoint()

The output is the following:

~/source/finviz (develop*) » python getdata.py                                                                                                                                                        1 ↵ tobi@ubuntu-vm
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 392/392 [02:13<00:00,  2.93it/s]
7823
> /home/name/source/finviz/getdata.py(17)<module>()
-> for stock in l_stock_list:
(Pdb) c
[...]
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
> /home/tobi/source/finviz/getdata.py(21)<module>()
-> for stock in l_stock_list:  # Loop through 10th - 20th stocks
(Pdb) 

from finviz.

shayant85 avatar shayant85 commented on August 21, 2024

It seems to me that finviz has gone from using pure html to Javascript so the "request.get" way and parsing with "beautifulsoup" used in this codebase no longer works. I think this code will require an overhaul to use something like selenium. Otherwise it's no longer usable.

from finviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.