I am trying to parse websites and get the XPath for specific pieces of content.
For example: On www.stackoverflow.com I want to get the XPath to the 'Questions' button. Using a Chrome extension I find that the following XPath can grab 'Questions':
/html/body[@class='home-page new-topbar']/div[@class='container']/div[@id='header']/div[@id='hmenus']/div[@class='nav mainnavs']/ul/li[1]/a[@id='nav-questions']
Now I want to know is a way to programmatically get the XPath for a given piece of content on a webpage?