zhegexiaohuozi/JsoupXpath

新功能期望

zctmdc opened this issue · 0 comments

Please answer these questions before submitting your issue. Thanks!

  1. What did you do(使用的表达式与使用场景,确保能够复现)?

xpathSelector()

  1. What did you expect to see(期望看到什么)?

该节点的Xpath

  1. What version of JsoupXpath are you using(当前版本)?
		<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
		<dependency>
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
			<version>1.11.3</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/cn.wanghaomiao/JsoupXpath -->
		<dependency>
			<groupId>cn.wanghaomiao</groupId>
			<artifactId>JsoupXpath</artifactId>
			<version>2.3.2</version>
		</dependency>
  1. 在 jsoup中有个方法很好用,就是
    String org.jsoup.nodes.Element.cssSelector()
    可以返回当前节点的cssSelector,希望开发者能开发出类似的功能
	String org.jsoup.nodes.Element.cssSelector()
     /**
     * Get a CSS selector that will uniquely select this element.
     * <p>
     * If the element has an ID, returns #id;
     * otherwise returns the parent (if any) CSS selector, followed by {@literal '>'},
     * followed by a unique selector for the element (tag.class.class:nth-child(n)).
     * </p>
     *
     * @return the CSS Path that can be used to retrieve the element in a selector.
     */