private static GTmetrix GTmetrixAnalyse(string companyUrl) { var uri = @"https://gtmetrix.com/reports/" + companyUrl; HtmlWeb web = new HtmlWeb(); HtmlDocument doc = new HtmlDocument(); try { doc = web.Load(uri); } catch (Exception) { } var pageSpeed = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.PageSpeed)?.InnerText.RemoveNumericFormat().TryToInt(); var yslow = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.YSlow)?.InnerText.RemoveNumericFormat().TryToInt(); var pageLoad = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.PageLoad)?.InnerText.RemoveNumericFormat().Replace("s", "").TryToDecimal(); var pageSize = doc.DocumentNode.SelectSingleNode(GTmetrixSelector.PageSize)?.InnerText.RemoveNumericFormat().Replace("MB", "").TryToDecimal(); var gtmetrix = new GTmetrix { PageSpeed = pageSpeed, YSlow = yslow, PageLoad = pageLoad, PageSize = pageSize }; return(gtmetrix); }
public Company() { Alexa = new Alexa(); SiteRankData = new SiteRankData(); SimilarWeb = new SimilarWeb(); GTmetrix = new GTmetrix(); Whois = new Whois(); }
public string TitleCSV() { var result = $"نام شرکت,آدرس,{Alexa.TitleCSV()},{SiteRankData.TitleCSV()},{SimilarWeb.TitleCSV()},{GTmetrix.TitleCSV()},{Whois.TitleCSV()}{Environment.NewLine}"; return(result); }
public string CompanyToCSV() { var result = $"{Name},{Url},{Alexa.ToCSV()},{SiteRankData.ToCSV()},{SimilarWeb.ToCSV()},{GTmetrix.ToCSV()},{Whois.ToCSV()}{Environment.NewLine}"; return(result); }