A
A
Asya2021-04-20 14:22:43
Python
Asya, 2021-04-20 14:22:43

How to extract a link from a Selenium WebElement?

when I do

webdriver.ActionChains(driver).move_to_element(my_link).click(my_link).perform()

then an error is thrown
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: https://www.verandaresort.com/contact.html has no size and location
  (Session info: chrome=90.0.4430.72)


in general, I don’t need to click on this element, but it’s enough to get a link (which just drops out in an error)

how to convert Selenium WebElement into just a link like in an error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-04-20
@asyaevloeva

url = my_link.get_attribute('href')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question