protected virtual bool Get7DayForecastFor(WalletInvestorDataItem item, string address, WalletInvestorPortalHelper helper) { helper.State = PortalState.LoadPage; helper.Chromium.Load(address); if (!helper.WaitUntil(Settings.AutorizationOperationWaitTimeInSeconds * 1000, () => helper.State == PortalState.PageLoaded)) { return(false); } item.ForecastLink = address; string text = helper.GetElementByIdContent("seven-day-forecast-desc"); if (text == "Get It Now!") { if (!helper.ClickOnObjectById("seven-day-forecast-desc")) { return(false); } if (!helper.WaitUntil(Settings.AutorizationOperationWaitTimeInSeconds * 1000, () => helper.FindElementById("usersubscriberforecast-email"))) { return(false); } if (!helper.SetElementValueById("usersubscriberforecast-email", "'" + helper.Login + "'")) { return(false); } if (!helper.ClickOnObjectById("usersubscriberforecast-agreement")) { return(false); } if (!helper.ClickOnObjectByClass("btn btn-success")) { return(false); } if (helper.WaitUntil(10000, () => helper.CheckElementByClassNameContent("swal2-confirm swal2-styled", "OK") == true)) { XtraMessageBox.Show("You did not unlock all of our 7 days forecasts for this E-mail: " + helper.Login + ". Please go to your mail client, find the e-mail from walletinvestor and active your e-mail by click on the link"); } helper.Wait(10000); } try { text = helper.GetElementByClassNameContent("number"); string[] items = text.Split(' '); item.LastPrice = Convert.ToDouble(RemoveGlyph(items[0])); text = helper.GetElementByIdContent("seven-day-forecast-desc"); items = text.Split(' '); if (items.Length != 2) { return(false); } item.Forecast7Day = (Convert.ToDouble(items[0].Trim()) - item.LastPrice) / item.LastPrice * 100; } catch (Exception) { return(false); } return(true); }
protected virtual bool Get7DayForecastFor(WalletInvestorDataItem item, string address, WalletInvestorPortalHelper helper) { helper.State = PortalState.LoadPage; helper.Chromium.Load(address); if (!helper.WaitUntil(5000, () => helper.State == PortalState.PageLoaded)) { return(false); } string text = helper.GetElementByIdContent("seven-day-forecast-desc"); if (text == "Get It Now!") { if (!helper.ClickOnObjectById("seven-day-forecast-desc")) { return(false); } if (!helper.WaitUntil(10000, () => helper.FindElementById("usersubscriberforecast-email"))) { return(false); } if (!helper.SetElementValueById("usersubscriberforecast-email", "'" + helper.Login + "'")) { return(false); } if (!helper.ClickOnObjectById("usersubscriberforecast-agreement")) { return(false); } if (!helper.ClickOnObjectByClass("btn btn-success")) { return(false); } helper.Wait(2000); } Registered = true; try { text = helper.GetElementByIdContent("seven-day-forecast-desc"); string[] items = text.Split(' '); if (items.Length != 2) { return(false); } item.Forecast7Day = (Convert.ToDouble(items[0].Trim()) - item.LastPrice) / item.LastPrice * 100; } catch (Exception) { return(false); } return(true); }