예제 #1
0
파일: screener.py 프로젝트: WSJUSA/finviz
    def __search_screener(self):
        """ Private function used to return data from the FinViz screener. """

        self._page_content, self._url = http_request_get(
            'https://finviz.com/screener.ashx',
            payload={
                'v': self._table,
                't': ','.join(self._tickers),
                'f': ','.join(self._filters),
                'o': self._order,
                's': self._signal,
                'c': ','.join(self._custom)
            })

        self._rows = self.__check_rows()
        self.headers = self.__get_table_headers()
        page_urls = scrape.get_page_urls(self._page_content, self._rows,
                                         self._url)
        pages_data = sequential_data_scrape(scrape.get_table, page_urls,
                                            self._delay, self.headers,
                                            self._rows)

        data = []
        for page in pages_data:
            for row in page:
                data.append(row)

        return data
예제 #2
0
    def __search_screener(self):
        """ Private function used to return data from the FinViz screener. """

        self._page_content, self._url = http_request_get(
            "https://finviz.com/screener.ashx",
            payload={
                "v": self._table,
                "t": ",".join(self._tickers),
                "f": ",".join(self._filters),
                "o": self._order,
                "s": self._signal,
                "c": ",".join(self._custom),
            },
        )

        self._rows = self.__check_rows()
        self.headers = self.__get_table_headers()
        pages_data = sequential_data_scrape(
            scrape.get_table,
            scrape.get_page_urls(self._page_content, self._rows, self._url),
            self._delay,
            self.headers,
            self._rows,
        )

        data = []
        for page in pages_data:
            for row in page:
                data.append(row)

        return data