Skip to content
Advertisement

How can I scrape a href that is hidden behind a placeholder?

I’m trying to scrape the below href from a site. There are several hrefs on the site which I intend to scrape and so I am looping through the site in order to store them all in one list. Below is an example of one of the hrefs.

JavaScript

Here is the section of my code in question. Commented out is my attempt to gather just the hrefs. As this is not working, for now I’m attempting to scrape the entirety of “col-md-4 h-gutter”

JavaScript

Below is what is being printed to terminal. As you can see the hrefs are hidden behind a placeholder.

JavaScript

How do I print out the value of href?

Advertisement

Answer

It’s much easier to use the json response. If you need it in a table form, just feed that into pandas:

JavaScript

Output: first 5 rows of 43 rows

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement