Here’s a simple way to get the XPath of an element on an HTML page in page.
- Right-click on the element on the web page, choose “Inspect Element” from the context-menu
- Right-click on the highlighted HTML line that appears in the Chrome Developer Tools view at the bottom of the browser window, choose “Copy XPath” from the context menu.
Very handy for use with something like Splinter’s find_by_xpath method.