Is there a way to retrieve the index of an HTML child tag based on its XPath? I encounter this situation with three elements in the right rail of a page:
//*[@id="ctl00_ctl50_g_3B684B74_3A19_4750_AA2A_FB3D56462880"]/div[1]/h4
//*[@id="ctl00_ctl50_g_3B684B74_3A19_4750_AA2A_FB3D56462880"]/div[2]/h4
//*[@id="ctl00_ctl50_g_3B684B74_3A19_4750_AA2A_FB3D56462880"]/div[3]/h4
If I have located the first element and want to extract the number inside the div tag, which is '1', how would I go about doing so?
I attempted to find a solution from a past post (How to count HTML child tag in Selenium WebDriver using Java) but am still struggling to grasp it.