Package us.codecraft.webmagic.selector
Interface Selectable
- All Known Implementing Classes:
AbstractSelectable
,Html
,HtmlNode
,Json
,PlainText
public interface Selectable
Selectable text.
- Since:
- 0.1.0
- Author:
- code4crafter@gmail.com
-
Method Summary
Modifier and TypeMethodDescriptionselect list with css selectorselect list with css selectorall()
multi string resultselect list with css selectorselect list with css selectorget()
single string resultextract by JSON Path expressionlinks()
select all linksboolean
match()
if result exist for selectnodes()
get all nodesselect list with regex, default group is group 1select list with regexreplace with regexextract by custom selectorselectList
(Selector selector) extract by custom selectortoString()
single string resultselect list with xpath
-
Method Details
-
xpath
select list with xpath- Parameters:
xpath
- xpath- Returns:
- new Selectable after extract
-
$
select list with css selector- Parameters:
selector
- css selector expression- Returns:
- new Selectable after extract
-
$
select list with css selector- Parameters:
selector
- css selector expressionattrName
- attribute name of css selector- Returns:
- new Selectable after extract
-
css
select list with css selector- Parameters:
selector
- css selector expression- Returns:
- new Selectable after extract
-
css
select list with css selector- Parameters:
selector
- css selector expressionattrName
- attribute name of css selector- Returns:
- new Selectable after extract
-
links
Selectable links()select all links- Returns:
- all links
-
regex
select list with regex, default group is group 1- Parameters:
regex
- regex- Returns:
- new Selectable after extract
-
regex
select list with regex- Parameters:
regex
- regexgroup
- group- Returns:
- new Selectable after extract
-
replace
replace with regex- Parameters:
regex
- regexreplacement
- replacement- Returns:
- new Selectable after extract
-
toString
String toString()single string result -
get
String get()single string result- Returns:
- single string result
-
match
boolean match()if result exist for select- Returns:
- true if result exist
-
all
multi string result- Returns:
- multi string result
-
jsonPath
extract by JSON Path expression- Parameters:
jsonPath
- jsonPath- Returns:
- result
-
select
extract by custom selector- Parameters:
selector
- selector- Returns:
- result
-
selectList
extract by custom selector- Parameters:
selector
- selector- Returns:
- result
-
nodes
List<Selectable> nodes()get all nodes- Returns:
- result
-