Wanted to write a Java program to extract all the Xpaths of a given HTML page. For POC, using Gmail login page as an example. In the example. i click on the google logo and it gives me an Xpath to it. I should be able to extract all the xpaths of all the elements through a JAVA program and be able to save in a json format. Ex: {"logo": "html/body/div[1]/div[1]/div/div", ....., .....}. Please suggest if there are any libraries available to carryout this task?
Image link to better explain: http://i65.tinypic.com/347zcj6.jpg "googleXpathExample"