public static void DownloadFinancial(StockSerie stockSerie) { if (stockSerie.Financial != null && stockSerie.Financial.DownloadDate.AddDays(7) > DateTime.Now) return; StockFinancial financial = new StockFinancial(); try { string shortName = stockSerie.StockGroup == StockSerie.Groups.ALTERNEXT ? "EP" : "P"; shortName += stockSerie.ShortName; DownloadFinancialSummary(financial, shortName); string url = "http://www.boursorama.com/bourse/profil/profil_finance.phtml?symbole=1r$ShortName".Replace("$ShortName", shortName); StockWebHelper swh = new StockWebHelper(); string html = swh.DownloadHtml(url); WebBrowser browser = new WebBrowser(); browser.ScriptErrorsSuppressed = true; browser.DocumentText = html; browser.Document.OpenNew(true); browser.Document.Write(html); browser.Refresh(); HtmlDocument doc = browser.Document; var divs = doc.GetElementsByTagName("div").Cast<HtmlElement>(); foreach (var div in divs) { if (div.InnerText != null && div.InnerText.StartsWith("Compte de")) { Console.WriteLine(div.InnerText); var tables = div.GetElementsByTagName("table").Cast<HtmlElement>(); financial.IncomeStatement = getTableData(tables.First()); break; } } foreach (var div in divs) { if (div.InnerText != null && div.InnerText.StartsWith("Bilan")) { Console.WriteLine(div.InnerText); var tables = div.GetElementsByTagName("table").Cast<HtmlElement>(); financial.BalanceSheet = getTableData(tables.First()); break; } } foreach (var div in divs) { if (div.InnerText != null && div.InnerText.StartsWith("Chiffres d'affaires")) { Console.WriteLine(div.InnerText); var tables = div.GetElementsByTagName("table").Cast<HtmlElement>(); financial.Quaterly = getTableData(tables.First()); break; } } financial.DownloadDate = DateTime.Now; stockSerie.Financial = financial; stockSerie.SaveFinancial(); } catch (Exception e) { Console.WriteLine(e.Message); } }