How to get the <span> text? but when you have an <img> in that <span> error!

Asked

Viewed 173 times

0

The following code picks up the span, but if he has a img presents an error.

user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(names))
user.click()

My system picks up the title of span and click on it. But when the title is followed by text and img I don’t know what to do.

  • 2

    Greetings, Carlos. I don’t know if you noticed, but we’re on [pt.so], so why don’t you ask your question in Portuguese? You should do the [tour] and read the [Ask] guide as well. If possible, cite examples of the HTML in question related to the problem.

  • can you understand ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.