View Javadoc
1   package us.codecraft.webmagic.selector;
2   
3   import org.jsoup.nodes.Element;
4   
5   import java.util.List;
6   
7   /**
8    * Selector(extractor) for html elements.<br>
9    *
10   * @author code4crafter@gmail.com <br>
11   * @since 0.3.0
12   */
13  public interface ElementSelector {
14  
15      /**
16       * Extract single result in text.<br>
17       * If there are more than one result, only the first will be chosen.
18       *
19       * @param element element
20       * @return result
21       */
22      public String select(Element element);
23  
24      /**
25       * Extract all results in text.<br>
26       *
27       * @param element element
28       * @return results
29       */
30      public List<String> selectList(Element element);
31  
32  }