hit counter


My development logbook

Find Out Parent HTML Element of a Webelement in Selenium

Sometimes you want to find out the parent HTML element of the current WebElement you are working on. The parent property of the WebElement, however, will give you an instance of WebDriver.

You can find this out by

parent = element.find_element_by_xpath('..')