Пример #1
0
        public static magazine3kPrint_01 loadPrint(string url)
        {
            ghxr.Load(url);
            magazine3kPrint_01 print = new magazine3kPrint_01();

            print.url   = url;
            print.title = ghxr.SelectValue("//div[@class='headline']", ".//text()");
            print.SetInfo1(ghxr.SelectValues("//div[@class='res_data']//text()"));
            print.imageUrl = ghxr.SelectValue("//div[@class='res_image']//img/@src");
            XmlNode node = ghxr.SelectNode("//div[@class='justi']:.:EmptyRow");

            print.SetInfo2(ghxr.SelectValue(node, ".//div/text()"));
            print.comment = ghxr.SelectValue(node, ".//div/following-sibling::text()");
            print.SetDownloadLinks(ghxr.SelectValues("//div[@class='download_top']/following-sibling::div", "./script/text()"));
            return(print);
        }
Пример #2
0
        public static magazine3kPrint_01[] search(string url, bool detail = false)
        {
            List <magazine3kPrint_01> prints = new List <magazine3kPrint_01>();

            ghxr.Load(url);
            while (true)
            {
                string    urlNextPage = ghxr.SelectValue("//a[@class='pBtnSelected']/following-sibling::a/@href:.:EmptyRow");
                XmlSelect select      = ghxr.Select("//div[@class='res']", "@class", ".//a/@href:.:n(href)", ".//a//text():.:n(label1)",
                                                    ".//span[1]//text():.:n(info1)", ".//span[2]//text():.:n(info2)", ".//span[3]//text():.:n(info3)", ".//span[4]//text():.:n(info4)",
                                                    ".//img/@src:.:n(img)", ".//div[@class='justi']//text():.:n(label2):Concat()", ".//div[@class='cat']/text():.:n(category)");
                while (select.Get())
                {
                    magazine3kPrint_01 print;
                    if (!detail)
                    {
                        print       = new magazine3kPrint_01();
                        print.url   = (string)select["href"];
                        print.title = (string)select["label1"];
                        print.SetCategory((string)select["category"]);
                        print.SetInfo1(new string[] { (string)select["info1"], (string)select["info2"], (string)select["info3"], (string)select["info4"] });
                        print.imageUrl = (string)select["img"];
                        print.SetInfo3((string)select["label2"]);
                    }
                    else
                    {
                        string urlDetail = (string)select["href"];
                        print = loadPrint(urlDetail);
                    }
                    prints.Add(print);
                }
                if (urlNextPage == null)
                {
                    break;
                }
                ghxr.Load(urlNextPage);
            }
            return(prints.ToArray());
        }
Пример #3
0
 public static magazine3kPrint_01[] search(string url, bool detail = false)
 {
     List<magazine3kPrint_01> prints = new List<magazine3kPrint_01>();
     ghxr.Load(url);
     while (true)
     {
         string urlNextPage = ghxr.SelectValue("//a[@class='pBtnSelected']/following-sibling::a/@href:.:EmptyRow");
         XmlSelect select = ghxr.Select("//div[@class='res']", "@class", ".//a/@href:.:n(href)", ".//a//text():.:n(label1)",
           ".//span[1]//text():.:n(info1)", ".//span[2]//text():.:n(info2)", ".//span[3]//text():.:n(info3)", ".//span[4]//text():.:n(info4)",
           ".//img/@src:.:n(img)", ".//div[@class='justi']//text():.:n(label2):Concat()", ".//div[@class='cat']/text():.:n(category)");
         while (select.Get())
         {
             magazine3kPrint_01 print;
             if (!detail)
             {
                 print = new magazine3kPrint_01();
                 print.url = (string)select["href"];
                 print.title = (string)select["label1"];
                 print.SetCategory((string)select["category"]);
                 print.SetInfo1(new string[] { (string)select["info1"], (string)select["info2"], (string)select["info3"], (string)select["info4"] });
                 print.imageUrl = (string)select["img"];
                 print.SetInfo3((string)select["label2"]);
             }
             else
             {
                 string urlDetail = (string)select["href"];
                 print = loadPrint(urlDetail);
             }
             prints.Add(print);
         }
         if (urlNextPage == null) break;
         ghxr.Load(urlNextPage);
     }
     return prints.ToArray();
 }
Пример #4
0
 public static magazine3kPrint_01 loadPrint(string url)
 {
     ghxr.Load(url);
     magazine3kPrint_01 print = new magazine3kPrint_01();
     print.url = url;
     print.title = ghxr.SelectValue("//div[@class='headline']", ".//text()");
     print.SetInfo1(ghxr.SelectValues("//div[@class='res_data']//text()"));
     print.imageUrl = ghxr.SelectValue("//div[@class='res_image']//img/@src");
     XmlNode node = ghxr.SelectNode("//div[@class='justi']:.:EmptyRow");
     print.SetInfo2(ghxr.SelectValue(node, ".//div/text()"));
     print.comment = ghxr.SelectValue(node, ".//div/following-sibling::text()");
     print.SetDownloadLinks(ghxr.SelectValues("//div[@class='download_top']/following-sibling::div", "./script/text()"));
     return print;
 }