1 package us.codecraft.webmagic.selector;
2
3 import org.w3c.dom.Node;
4
5 import java.util.List;
6
7 /**
8 * Selector(extractor) for html node.<br>
9 *
10 * @author hooy <br>
11 * @since 0.8.0
12 */
13 public interface NodeSelector {
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 node node
20 * @return result
21 */
22 String select(Node node);
23
24 /**
25 * Extract all results in text.<br>
26 *
27 * @param node node
28 * @return results
29 */
30 List<String> selectList(Node node);
31
32 }