Exemple #1
0
        protected override void Handle(Page page)
        {
            var dataList = page.Selectable.SelectList(Selectors.XPath("//tr[@class='greybg']")).Nodes();

            foreach (var data in dataList)
            {
                ssqHistory ssq = new ssqHistory();
                ssq.qs   = data.Select(Selectors.XPath(".//td")).GetValue();
                ssq.red  = data.Select(Selectors.XPath(".//b[@class='fred']")).GetValue();
                ssq.blue = data.Select(Selectors.XPath(".//b[@class='fblue']")).GetValue();
                page.AddResultItem("ssqResult", ssq);
                break;
            }
        }
Exemple #2
0
        public override void Process(IEnumerable <ResultItems> resultItems, ISpider spider)
        {
            var data = resultItems.GetEnumerator();

            while (data.MoveNext())
            {
                ssqHistory          ssq      = data.Current.Results["ssqResult"];
                List <SqlParameter> parmList = new List <SqlParameter>();
                parmList.Add(new SqlParameter("@qs", ssq.qs));
                parmList.Add(new SqlParameter("@red", ssq.red));
                parmList.Add(new SqlParameter("@blue", ssq.blue));
                DbHelper.ExecutePrc("prc_save_ssqHistory", parmList.ToArray());
            }
        }