FINVIZFINANCE ISSUE WHEN GETTING TICKER INFO
opened this issue · comments
When I use:
from finvizfinance.quote import finvizfinance
stock = finvizfinance('tsla')
stock.ticker_fundament()
I get:
IndexError Traceback (most recent call last)
stock = finvizfinance('tsla')
stock.ticker_fundament()
in finvizfinance.ticker_fundament(self, raw, output_format)
134 rows = table.findAll("tr")
136 fundament_info["Company"] = rows[1].text
137 (
138 fundament_info["Sector"],
139 fundament_info["Industry"],
140 fundament_info["Country"],
--> 141 ) = rows[2].text.split(" | ")
143 fundament_table = self.soup.find("table", class_="snapshot-table2")
144 rows = fundament_table.findAll("tr")
IndexError: list index out of range
Any clue???
The website now have light and dark mode which show differently. I am currently looking into this.
Hi @lit26,
The indexing used here is wrong. Maybe it worked before but I made the function work by using the rows[0]
and rows[1]
index,
table = self.soup.find("table", class_="fullview-title")
rows = table.findAll("tr")
fundament_info["Company"] = rows[0].text
(
fundament_info["Sector"],
fundament_info["Industry"],
fundament_info["Country"],
) = rows[1].text.split(" | ")
Thank you for creating and maintaining the project!
Should be fixed in #73. Release in v0.14.6rc1. Thanks for reporting.