Example #1
0
 private void GetSetores()
 {
     if (FIIs.Count > 0)
     {
         setores = FIIs.Select(x => x.Setor).Distinct().ToArray();
     }
 }
Example #2
0
 private void Cull()
 {
     while (FIIs.Any(x => x.QtdeAtivos == 1))
     {
         FIIs.Remove(FIIs.First(x => x.QtdeAtivos == 1));
     }
 }
Example #3
0
        private void Scrape()
        {
            string page = "https://www.fundsexplorer.com.br/ranking";

            var web = new HtmlWeb();
            var doc = web.Load(page);

            var LinhasResult = doc.DocumentNode.SelectNodes("//tr");

            if (LinhasResult != null)
            {
                foreach (var linha in LinhasResult)
                {
                    List <string> aux            = new List <string>();
                    var           dadosnumericos = linha.SelectNodes(".//td");

                    if (dadosnumericos != null)
                    {
                        foreach (var dado in dadosnumericos)
                        {
                            aux.Add(HttpUtility.HtmlDecode(dado.InnerText));
                        }
                        try
                        {
                            FIIs.Add(new FII(aux));
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }
        }