| 限定符和类型 | 方法和说明 |
|---|---|
Links |
add(Collection<String> urls) |
Links |
add(Links links) |
Links |
add(String url) |
Links |
addAllFromDocument(org.jsoup.nodes.Document doc) |
Links |
addByRegex(org.jsoup.nodes.Document doc,
RegexRule regexRule) |
Links |
addByRegex(org.jsoup.nodes.Document doc,
RegexRule regexRule,
boolean parseImg) |
Links |
addByRegex(org.jsoup.nodes.Document doc,
String rule) |
Links |
addBySelector(org.jsoup.nodes.Document doc,
String cssSelector)
添加doc中,满足选择器的元素中的链接 选择器cssSelector必须定位到具体的超链接
例如我们想抽取id为content的div中的所有超链接,这里 就要将cssSelector定义为div[id=content] a
|
void |
clear() |
Links |
filterByRegex(RegexRule regexRule) |
Links |
filterByRegex(String regex) |
String |
get(int index) |
int |
indexOf(String url) |
boolean |
isEmpty() |
Iterator<String> |
iterator() |
String |
remove(int index) |
boolean |
remove(String url) |
int |
size() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Links()
public Links(Links links)
public Links(Collection<String> urls)
public Links add(Collection<String> urls)
public Links addAllFromDocument(org.jsoup.nodes.Document doc)
public Links addBySelector(org.jsoup.nodes.Document doc, String cssSelector)
doc - 网页DocumentcssSelector - CSS选择器public Links addByRegex(org.jsoup.nodes.Document doc, RegexRule regexRule, boolean parseImg)
public String get(int index)
public int size()
public String remove(int index)
public boolean remove(String url)
public void clear()
public boolean isEmpty()
public int indexOf(String url)
Copyright © 2017. All Rights Reserved.