You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~\anaconda3\lib\site-packages\finviz\screener.py:436, in Screener.__search_screener(self)
421 """ Private function used to return data from the FinViz screener. """
423 self._page_content, self._url = http_request_get(
424 "https://finviz.com/screener.ashx",
425 payload={
(...)
433 user_agent=self._user_agent,
434 )
--> 436 self._rows = self.__check_rows()
437 self.headers = self.__get_table_headers()
439 if self._request_method == "async":
File ~\anaconda3\lib\site-packages\finviz\screener.py:404, in Screener.__check_rows(self)
398 def __check_rows(self):
399 """
400 Checks if the user input for row number is correct.
401 Otherwise, modifies the number or raises NoResults error.
402 """
--> 404 self._total_rows = scrape.get_total_rows(self._page_content)
406 if self._total_rows == 0:
407 raise NoResults(self._url.split("?")[1])
File ~\anaconda3\lib\site-packages\finviz\helper_functions\scraper_functions.py:46, in get_total_rows(page_content)
42 """ Returns the total number of rows(results). """
44 total_element = page_content.cssselect('td[width="128"]')
45 total_number = (
---> 46 etree.tostring(total_element[0]).decode("utf-8").split("")[1].split()[0]
47 )
49 try:
50 return int(total_number)
IndexError: list index out of range
The text was updated successfully, but these errors were encountered:
Can anyone help me with these errors:
IndexError Traceback (most recent call last)
Cell In[1], line 20
9 filters = Screener.load_filter_dict()
11 filters = [
12 "cap_small",
13 "fa_sales5years_pos",
(...)
18 "ta_volatility_mo3&ft=4&o=ticker"
19 ]
---> 20 stock_list = Screener(filters=filters, table="Performance")
22 print(stock_list)
25 # Monthly, Candles, Large, No Technical Analysis
File ~\anaconda3\lib\site-packages\finviz\screener.py:128, in Screener.init(self, tickers, filters, rows, order, signal, table, custom, user_agent, request_method)
125 self._request_method = request_method
127 self.analysis = []
--> 128 self.data = self.__search_screener()
File ~\anaconda3\lib\site-packages\finviz\screener.py:436, in Screener.__search_screener(self)
421 """ Private function used to return data from the FinViz screener. """
423 self._page_content, self._url = http_request_get(
424 "https://finviz.com/screener.ashx",
425 payload={
(...)
433 user_agent=self._user_agent,
434 )
--> 436 self._rows = self.__check_rows()
437 self.headers = self.__get_table_headers()
439 if self._request_method == "async":
File ~\anaconda3\lib\site-packages\finviz\screener.py:404, in Screener.__check_rows(self)
398 def __check_rows(self):
399 """
400 Checks if the user input for row number is correct.
401 Otherwise, modifies the number or raises NoResults error.
402 """
--> 404 self._total_rows = scrape.get_total_rows(self._page_content)
406 if self._total_rows == 0:
407 raise NoResults(self._url.split("?")[1])
File ~\anaconda3\lib\site-packages\finviz\helper_functions\scraper_functions.py:46, in get_total_rows(page_content)
42 """ Returns the total number of rows(results). """
44 total_element = page_content.cssselect('td[width="128"]')
45 total_number = (
---> 46 etree.tostring(total_element[0]).decode("utf-8").split("")[1].split()[0]
47 )
49 try:
50 return int(total_number)
IndexError: list index out of range
The text was updated successfully, but these errors were encountered: