Skip to content

Commit

Permalink
Merge pull request #88 from lit26/fix/customs-extra-columns
Browse files Browse the repository at this point in the history
Add extra columns for custom screener
  • Loading branch information
lit26 authored Oct 2, 2023
2 parents 656cbd5 + b6fb3c8 commit e3e36ca
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions finvizfinance/screener/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@
68: "Earnings Date",
69: "Target Price",
70: "IPO Date",
73: "Book value per share",
74: "Cash per share",
75: "Dividend",
76: "Employees",
77: "EPS estimate next quarter",
78: "Income",
79: "Index",
80: "Optionable",
81: "Previous Close",
82: "Sales",
83: "Shortable",
84: "Short Interest",
85: "Float/Outstanding",
86: "Open",
87: "High",
88: "Low",
}


Expand Down Expand Up @@ -147,6 +163,10 @@ def screener_view(
url = self.url + "&" + self.order_dict[order]
if not ascend:
url = url.replace("o=", "o=-")

if 0 in columns:
columns.remove(0)
columns.insert(0, 0)
columns = [str(i) for i in columns]
url += "&c=" + ",".join(columns)
soup = web_scrap(url)
Expand Down

1 comment on commit e3e36ca

@ljilekor
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the columns causes 2 identical "Dividend" values

14: "Dividend"
75: "Dividend"

Overwrite dict key conflict in screener/overview.py _get_table()
when filling the info_dict with table_header[i]

Please sign in to comment.