def setUp(self): self.ticker = "GNG" self.type = "balance" data_dir = "..\\testData\\" store = Storage(data_dir) self.assets = pandas.read_pickle(data_dir + "GNG\\GNGassets.pkl") self.liabilities = pandas.read_pickle(data_dir + "GNG\\GNGliabilities.pkl") self.scraper = WSJscraper(store)
def retrieveOverviewData(storage_dir, headings = None): store = Storage(storage_dir) xls = XLSio(store) scraper = WSJscraper(store) xls.loadWorkbook("ASXListedCompanies") tickers = xls.getTickers() new_data = {} for ticker in tickers: scraper.load_overview(ticker) try: new_data[ticker] = scraper.keyStockData() except Exception: print("Problem with: " + ticker) xls.updateTable(new_data) xls.saveAs("StockSummary")
def setUp(self): self.ticker = "SRV" self.type = "overview" self.data_dir = "..\\testData\\" self.store = Storage(self.data_dir) self.expected = { "P/E Ratio (TTM)": 21.68, "EPS (TTM)": 0.34, "Market Cap": 698.87, "Shares Outstanding": 98.43, "Public Float": 43.03, "Yield": 3.01, "Latest Dividend": 0.11, "Ex-Dividend Date": "09/07/15" } self.scraper = WSJscraper(self.store) self.scraper.overview = BeautifulSoup( open(self.store.html(self.ticker, self.type)), "lxml")
def setUp(self): self.ticker = "SRV" self.type = "overview" self.data_dir = "..\\testData\\" self.store = Storage(self.data_dir) self.scraper = WSJscraper(self.store)