-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screener data and headers are empty #191
Comments
I have the same issue, thank you for identifying the cause. |
Replacing all instances of |
I changed all th to th, but now I am getting this error in my program: File ~\anaconda3\lib\site-packages\finviz\screener.py:182, in Screener.str(self) File ~\anaconda3\lib\site-packages\finviz\screener.py:182, in (.0) |
I have the same issue after change "td" to "th"
|
I tried to trace back the issue. I think that the problem may be in line 254 of the Screener function: th.get_text().strip() == "Exchange": I think that the word "Exchange" is not present in bs.find_all("th"). This is what I get from that search: for th in bs.find_all("th"): |
This did NOT fix it for me. What fixed it was to replace 'td' with 'th' only in line 417 of screener.py (in function get_table_headers):
|
Any solutions to the problem??? |
Hi:
Have you find a solution???
Regards,
José
El vie, 6 oct 2023 a las 2:50, JJ ***@***.***>) escribió:
… I have the same issue with
I changed all th to th, but now I am getting this error in my program:
KeyError Traceback (most recent call last) Cell In[1], line 38 28 filters =
[ 29 "fa_debteq_u1", 30 "fa_roe_o10", (...) 34 "ta_sma50_pa&ft=4" 35 ] 36
stock_list = Screener(filters=filters, table="Performance") ---> 38
print(stock_list) 41 # Monthly, Candles, Large, No Technical Analysis 42 if
valperiod == "d":
File ~\anaconda3\lib\site-packages\finviz\screener.py:182, in Screener.
*str*(self) 179 table_list = [self.headers] 181 for row in self.data: -->
182 table_list.append([row[col] or "" for col in self.headers]) 184 return
create_table_string(table_list)
File ~\anaconda3\lib\site-packages\finviz\screener.py:182, in (.0) 179
table_list = [self.headers] 181 for row in self.data: --> 182
table_list.append([row[col] or "" for col in self.headers]) 184 return
create_table_string(table_list) KeyError´Change´
I have the issue above
—
Reply to this email directly, view it on GitHub
<#191 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYXWWE35NCUOOCWNWCJBWD3X57A4JAVCNFSM6AAAAAA5NOEQGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJQGIZDAMZSGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
this worked for me! |
Finviz changed in the last days their screener table and now the headers of the table are in
<th>
instead of<td>
, which makes the data and the headers of Screener class to be empty after constructing.Before:
<td class="table-top cursor-pointer" align="right" onclick="window.location='screener.ashx?v=111'">No.</td>
After:
<th class="table-header cursor-pointer" align="right" onclick="window.location='screener.ashx?v=111'">No.</th>
The text was updated successfully, but these errors were encountered: