jhy/jsoup — pull request #459 by enricobacis (2014-09-10 10:15:35+00:00)
Title: Add method cssPath to Element to get the CSS unique path of an element.

Add method `cssPath()` to the class Element. This is used to retrieve a CSS query that selects this single element. Consider the following HTML as example:

A

B

C

The first `div` has an id, so its CSS Path will be:

#id1

The second `div` doesn't have any id or class so its CSS Path will be:

#root > html > body > div:nth-child(2)

(the `#root` element is automatically added by Jsoup).

The third `div` has a couple of classes unique among its siblings, so its CSS Path will be:

#root > html > body > div.c1.c2

You can check more information on [this](http://stackoverflow.com/questions/25724112/find-css-path-from-jsoup-element) stackoverflow question.