Exemplo n.º 1
0
        public async Task <StockData> ReadStockValue()
        {
            try
            {
                var stockVal = _driver.FindElementById("quote-header-info")
                               .FindElement(By.CssSelector("span[data-reactid='32']")).Text;
                var data = new StockData()
                {
                    Time = DateTime.Now, CurrentPrice = Convert.ToDecimal(stockVal), Stock = _stock
                };
                await _signalRService.SendMessageToAll("transferStockData", data);

                return(data);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }