mariostoev/finviz

Screener header now includes whitespace characters

Opened this issue · 3 comments

oboxer commented

As of 2023/04/27, this is the new table header from finviz.
['No.', '\r\n ', '\r\n', 'Ticker', 'Company', 'Sector', 'Industry', 'Country', 'Market Cap', 'P/E', 'Price', 'Change', 'Volume']

{'No.': '1', '\r\n ': 'ABCB', '\r\n': 'Ameris Bancorp', 'Ticker': 'Financial', 'Company': 'Banks - Regional', 'Sector': 'USA', 'Industry': '2.30B', 'Country': '6.54', 'Market Cap': '33.86', 'P/E': '3.74%', 'Price': '142,889'}......can we get this fixed ASAP please.

oboxer commented

Replace below in this method __get_table_headers. Someone please feel free to create PR

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

        headers = self._page_content.cssselect(
            'tr[valign="middle"]')[0].xpath("td//text()")
        # remove \r\n in headers
        return list(filter(lambda x: x.strip(), headers))

@oboxer 's fix is in a PR now #168