Exemple #1
0
        public List <string> GetProxy()
        {
            List <string> lstProxy = new List <string>();

            foreach (ConfigWebsite configItem in FactoryConfigWebsite.Instance().GetListConfigWebsite())
            {
                foreach (string url in configItem.RootLinks)
                {
                    GABIZ.Base.HtmlAgilityPack.HtmlDocument document = new GABIZ.Base.HtmlAgilityPack.HtmlDocument();
                    document.LoadHtml(GetHtmlCode(url));
                    var nodes = document.DocumentNode.SelectNodes(configItem.XPath);
                    if (nodes != null && nodes.Count > 0)
                    {
                        foreach (var aNode in nodes)
                        {
                            lstProxy.Add(aNode.Attributes["href"].Value.ToString());
                        }
                    }
                }
            }
            return(lstProxy);
        }
Exemple #2
0
 public static FactoryConfigWebsite Instance()
 {
     return((_instance == null) ? _instance = new FactoryConfigWebsite() : _instance);
 }