xpath_parse

Creator: coderz1093

Last updated:

0 purchases

xpath_parse Image
xpath_parse Images
Add to Cart

Description:

xpath parse

xpath #


XPath selector based on html.
Get started #
Add dependency #
dependencies:
xpath_parse: lastVersion
copied to clipboard
Super simple to use #
final String html = '''
<html>
<div><a href='https://github.com'>github.com</a></div>
<div class="head">head</div>
<table><tr><td>1</td><td>2</td><td>3</td><td>4</td></tr></table>
<div class="end">end</div>
</html>
''';

XPath.source(html).query("//div/a/text()").list()

copied to clipboard
more simple refer to this
Syntax supported: #


Name
Expression


immediate parent
/


parent
//


attribute
[@key=value]


nth child
tag[n]


attribute
/@key


wildcard in tagname
/*


function
function()


Extended syntax supported: #
These XPath syntax are extended only in Xsoup (for convenience in extracting HTML, refer to Jsoup CSS Selector):


Name
Expression
Support


attribute value not equals
[@key!=value]
yes


attribute value start with
[@key~=value]
yes


attribute value end with
[@key$=value]
yes


attribute value contains
[@key*=value]
yes


attribute value match regex
[@key~=value]
yes

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.