コード例 #1
0
        public static string _querySelector(this NextPageConfig next, IHtmlDocument dom, string currentPage)
        {
            if (next.NextPageRule != null)
            {
                return(next.NextPageRule._querySelector(dom, currentPage));
            }
            ;
            // 动态获取
            if (string.IsNullOrEmpty(next.QuerySelector))
            {
                return("");
            }
            if (next.QueryItem == null)
            {
                next.QueryItem = new QueryItem();
            }
            var element = dom.QuerySelector(next.QuerySelector);

            if (element == null)
            {
                return("");
            }
            return(next.QueryItem._queryItems(element));
        }
コード例 #2
0
 public DriectSpider SetConfig(NextPageConfig config)
 {
     _nexPageConfig = config;
     return(this);
 }