public HtmlExtractor Seek(IElementPredicate predicate) { lastMatch = null; SeekWithin(predicate, null); return this; }
public HtmlExtractor Seek(IElementPredicate predicate) { lastMatch = null; SeekWithin(predicate, null); return(this); }
/// <summary> /// Does not do tag balancing. /// </summary> public string CollectHtmlUntilPredicate(IElementPredicate elementp) { StringBuilder result = new StringBuilder(); Element el; while (null != (el = Next())) { if (elementp.IsMatch(el)) { break; } result.Append(html, el.Offset, el.Length); } return(result.ToString()); }
public HtmlExtractor MatchNext(IElementPredicate predicate, bool ignoreWhitespace) { lastMatch = null; Element e; do { e = parser.Next(); }while (e != null && ignoreWhitespace && IsWhitespaceOrZeroLengthText(e)); if (e != null && predicate.IsMatch(e)) { lastMatch = e; } return(this); }
public HtmlExtractor SeekWithin(IElementPredicate predicate, IElementPredicate withinPredicate) { lastMatch = null; Element e; while (null != (e = parser.Next())) { if (predicate.IsMatch(e)) { lastMatch = e; break; } if (withinPredicate != null && withinPredicate.IsMatch(e)) { break; } } return(this); }
public SmartPredicate(string criterion) { actualPredicate = HtmlExtractor.Parse(criterion); }
public PredicatePair(IElementPredicate match, IElementPredicate stop) { _match = match; _stop = stop; }
/// <summary> /// Does not do tag balancing. /// </summary> public string CollectTextUntilPredicate(IElementPredicate elementp) { return(HtmlUtils.HTMLToPlainText(CollectHtmlUntilPredicate(elementp))); }
public HtmlExtractor SeekWithin(IElementPredicate predicate, IElementPredicate withinPredicate) { lastMatch = null; Element e; while (null != (e = parser.Next())) { if (predicate.IsMatch(e)) { lastMatch = e; break; } if (withinPredicate != null && withinPredicate.IsMatch(e)) break; } return this; }
/// <summary> /// Does not do tag balancing. /// </summary> public string CollectHtmlUntilPredicate(IElementPredicate elementp) { StringBuilder result = new StringBuilder(); Element el; while (null != (el = Next())) { if (elementp.IsMatch(el)) break; result.Append(html, el.Offset, el.Length); } return result.ToString(); }
/// <summary> /// Does not do tag balancing. /// </summary> public string CollectTextUntilPredicate(IElementPredicate elementp) { return HtmlUtils.HTMLToPlainText(CollectHtmlUntilPredicate(elementp)); }
public HtmlExtractor MatchNext(IElementPredicate predicate, bool ignoreWhitespace) { lastMatch = null; Element e; do { e = parser.Next(); } while (e != null && ignoreWhitespace && IsWhitespaceOrZeroLengthText(e)); if (e != null && predicate.IsMatch(e)) lastMatch = e; return this; }