I'm currently trying to execute this command, trying to select:
driver.find_element_by_xpath("//a[contains(@href, 'mailto')]/@href").getAttribute("href")
To get X when <a href="X">
.
It shows me this error:
invalid selector: The result of the xpath expression "//a[contains(@href, 'mailto')]/@href" is: [object Attr]. It should be an element.
I have tryed .getAttribute but without success. Could anyone help me with this ?
Thanks