Ejemplo n.º 1
0
        public Job GetDetail(string url)
        {
            Job info = new Job();

            Parser parser = ParserHelp.GetParser(url);

            NodeFilter miaoShu = new HasAttributeFilter("id", "miaoshu");
            NodeFilter mainBox = new HasAttributeFilter("class", "mainBox");
            NodeFilter orfilter = new OrFilter(miaoShu, mainBox);

            NodeList list = new NodeList();
            list = parser.Parse(orfilter);
            if (list == null || list.Count < 2)
            {
                return info;
            }

            GetMiaoShu(list, ref info);
            GetContartInfo(list, ref info);

            return info;
        }
Ejemplo n.º 2
0
        public NodeList GetDetailPageForHtml(string html)
        {
            Parser parse = GetParser(html);

            NodeFilter showidFilter = new HasAttributeFilter("id", "detail");
            NodeFilter showclassFilter = new HasAttributeFilter("class", "box");
            AndFilter showFilter = new AndFilter(showidFilter, showclassFilter);

            NodeFilter contentidFilter = new HasAttributeFilter("id", "J_DivItemDesc");
            NodeFilter contentclassFilter = new HasAttributeFilter("class", "content");
            AndFilter contentFilter = new AndFilter(contentidFilter, contentclassFilter);

            OrFilter orFitler = new OrFilter(showFilter, contentFilter);

            return parse.Parse(orFitler);
        }