I have this element and I want to access its Xpath by code, not find element by Xpath like find_element(By.XPATH,'myXpath') and not get xpath it manually on the browser
today = driver.find_element(By.CLASS_NAME,'today')
day = today.get_attribute("data-day")
xpathString = today.get_xpath() # <--- this function doesn't exist
we can get the attribute of an element by get_attribute() function, but I couldn't find the function that returns the Xpath of the element.
please is it possible? thanks in advance!