Skip to content

Commit

Permalink
Fix typo in toml file and headers mis-alignment (mariostoev#184)
Browse files Browse the repository at this point in the history
* Update pyproject.toml

removed typo at the end of the toml file

* Fix header names including SVG elements
  • Loading branch information
igalci authored Oct 6, 2023
1 parent bffd07a commit bc02ca9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions finviz/screener.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,18 @@ def __check_rows(self):

def __get_table_headers(self):
""" Private function used to return table headers. """

return self._page_content.cssselect('tr[valign="middle"]')[0].xpath(
"td//text()"
)
headers = []

header_elements = self._page_content.cssselect('tr[valign="middle"]')[0].xpath("td")

for header_element in header_elements:
# Use normalize-space to extract text content while ignoring internal elements
header_text = header_element.xpath("normalize-space()")

if header_text:
headers.append(header_text)

return headers

def __search_screener(self):
""" Private function used to return data from the FinViz screener. """
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ dependencies =[
requires-python = ">=3.8"

[tools.setuptools]
packages = ["finviz"]git
packages = ["finviz"]

0 comments on commit bc02ca9

Please sign in to comment.