Package us.codecraft.webmagic.selector
Class BaseElementSelector
- java.lang.Object
-
- us.codecraft.webmagic.selector.BaseElementSelector
-
- All Implemented Interfaces:
ElementSelector
,Selector
- Direct Known Subclasses:
CssSelector
,LinksSelector
,XpathSelector
public abstract class BaseElementSelector extends java.lang.Object implements Selector, ElementSelector
- Since:
- 0.3.0
- Author:
- code4crafter@gmail.com
-
-
Constructor Summary
Constructors Constructor Description BaseElementSelector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
hasAttribute()
java.lang.String
select(java.lang.String text)
Extract single result in text.
If there are more than one result, only the first will be chosen.org.jsoup.nodes.Element
selectElement(java.lang.String text)
abstract org.jsoup.nodes.Element
selectElement(org.jsoup.nodes.Element element)
java.util.List<org.jsoup.nodes.Element>
selectElements(java.lang.String text)
abstract java.util.List<org.jsoup.nodes.Element>
selectElements(org.jsoup.nodes.Element element)
java.util.List<java.lang.String>
selectList(java.lang.String text)
Extract all results in text.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface us.codecraft.webmagic.selector.ElementSelector
select, selectList
-
-
-
-
Method Detail
-
select
public java.lang.String select(java.lang.String text)
Description copied from interface:Selector
Extract single result in text.
If there are more than one result, only the first will be chosen.
-
selectList
public java.util.List<java.lang.String> selectList(java.lang.String text)
Description copied from interface:Selector
Extract all results in text.- Specified by:
selectList
in interfaceSelector
- Parameters:
text
- text- Returns:
- results
-
selectElement
public org.jsoup.nodes.Element selectElement(java.lang.String text)
-
selectElements
public java.util.List<org.jsoup.nodes.Element> selectElements(java.lang.String text)
-
selectElement
public abstract org.jsoup.nodes.Element selectElement(org.jsoup.nodes.Element element)
-
selectElements
public abstract java.util.List<org.jsoup.nodes.Element> selectElements(org.jsoup.nodes.Element element)
-
hasAttribute
public abstract boolean hasAttribute()
-
-