|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxsmeral.semnet.util.XPathUtil
public class XPathUtil
Utility class for scrapers, simplifies XPath querying. It is dependent on the HtmlCleaner API.
AbstractScraper
Constructor Summary | |
---|---|
XPathUtil()
|
Method Summary | |
---|---|
static String |
getText(Object node)
Returns text content of a node. |
static List<TagNode> |
queryNodes(TagNode node,
String xpath)
Queries the supplied node with the supplied XPath expression and returns list of matching nodes |
static String |
queryText(TagNode node,
String xpath)
Queries the supplied node with the supplied XPath expression and returns the text content. |
static List<String> |
queryTextNodes(TagNode node,
String xpath)
Queries the supplied node with the supplied XPath expression and returns list of text contents of the matched nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XPathUtil()
Method Detail |
---|
public static String getText(Object node)
node
- The node (a String, TagNode or ContentNode)
String.trim()
public static String queryText(TagNode node, String xpath) throws XPatherException
node
- The node to queryxpath
- The query
XPatherException
public static List<String> queryTextNodes(TagNode node, String xpath) throws XPatherException
node
- The node to queryxpath
- The query
XPatherException
public static List<TagNode> queryNodes(TagNode node, String xpath) throws XPatherException
node
- The node to queryxpath
- The query
XPatherException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |