Example #1
0
        /// <summary>
        /// Scraps the specified column rules.
        /// </summary>
        /// <param name="ColumnRules">The column rules.</param>
        /// <param name="Reduce">if set to <c>true</c> [reduce].</param>
        /// <returns>List&lt;ExtractDoc&gt;.</returns>
        public List <Kuto> Scrap(List <ScrapRule> ColumnRules, bool Reduce = false)
        {
            List <Kuto> ret    = new List <Kuto>();
            Kuto        tmpDoc = new Kuto(this.ToString());

            foreach (ScrapRule Rule in ColumnRules)
            {
                ret.Add(tmpDoc.Extract(Rule.startString, Rule.endString));
                if (Reduce)
                {
                    tmpDoc = tmpDoc.Extract(Rule.endString, "");
                }
            }
            return(ret);
        }
Example #2
0
        /// <summary>
        /// Scraps the specified condition.
        /// </summary>
        /// <param name="Condition">The condition.</param>
        /// <param name="ColumnRules">The column rules.</param>
        /// <returns>List&lt;List&lt;ExtractDoc&gt;&gt;.</returns>
        public List <List <Kuto> > Scrap(string Condition, List <ScrapRule> ColumnRules)
        {
            List <List <Kuto> > rows = new List <List <Kuto> >();
            Kuto tmpDoc = new Kuto(this.ToString());

            while (tmpDoc.Contains(Condition))
            {
                rows.Add(tmpDoc.Scrap(ColumnRules));
                tmpDoc = tmpDoc.Extract(Condition, "");
            }


            return(rows);
        }