I fetch data from Google’s AdWords website which has multiple elements with the same id.
I would like to get an XPath of a given element.
Could you suggest a jQuery / JavaScript function that can calculate an XPath of a given element assuming that the page may contain multiple elements with the same id?
Please don’t tell me that I shouldn’t have multiple elements with the same id. It wasn’t my idea…
You know you can access the the xpath using
//*[@id='blah'][1]and[2]etc. is that the answer you’re looking for?