示例#1
0
 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)
示例#2
0
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")
示例#3
0
 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")
示例#4
0
 def setUp(self):
     self.ticker = "SRV"
     self.type = "overview"
     self.data_dir = "..\\testData\\"
     self.store = Storage(self.data_dir)
     self.scraper = WSJscraper(self.store)