Skip to content
Advertisement

Click to expand all clickable elements inside a website by Python

I’m trying to collect and save all the links that are inside the called tags href that are always on this path of elements:

JavaScript

enter image description here

The script I’m using is this:

JavaScript

The problem is that in this model I can’t get the values that are hidden because of the elements that need to be expanded from a link in order to access them:

enter image description here

I’m trying to create a template so I can click all the buttons to expand and only then collect the links, but the button isn’t expanding even using the .click, I would like some help to understand how I need to use it so that my need is met.

Element clickable:

JavaScript

My script trying to clicks:

JavaScript

Advertisement

Answer

JavaScript

Output:

JavaScript

Updated Answer:

JavaScript

Output:

JavaScript

Quicker Version:

JavaScript

Note: pip install trio httpx

Advertisement