Skip to content
Advertisement

Extracting texts from Selenium WebElement

I’m trying to get all the names of the perfumes on this page

introducir la descripción de la imagen aquí

But when I try to get the text of the web element attribute I get nothing. In fact, I tried en colaboratory:

JavaScript

En media_content we have several elements:

JavaScript

But this one does not return anything:

JavaScript

I also tried using the xpath directly on one name I wass looking for but it returns nothing as well.

So how do I get the text of a WebElement ?

Advertisement

Answer

To display all 25 of the names do the following.

JavaScript

I also used to click on the agree popup.

JavaScript

Outputs

JavaScript
Advertisement