Comments (2)
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.
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)
- KeyError: Sector name is wrong HOT 1
- Issue with screener
- SCREENER ERROR
- Header contains line feed code and blank characters when retrieving header HOT 1
- No results found for query when using Screener HOT 5
- Screener returning data with empty columns added HOT 2
- ValueError when converting date HOT 2
- Can't Call get_crypto(pair) with the pair name only it's number
- IndexError: list index out of range HOT 8
- Header labels are not aligned with content HOT 2
- duplicate column name in sqllite database initialization
- INDEX OUT OF RANGE HOT 1
- Issue with pyproject.toml when I try to pip install HOT 1
- News Date Issue HOT 9
- Screener data and headers are empty HOT 9
- finviz api Unable to parse page for ticker
- list index out of range HOT 13
- ValueError: time data '\r\n Today 07:00AM\r\n ' does not match format '%b-%d-%y %I:%M%p'
- get_stock() IndexError: list index out of range on line to fetch `company_details`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finviz.