Skip to content
Advertisement

How to identify a link from href based on string and class name?

I’m trying to get some data from https://betsapi.com/, specifically from the soccer area using python I saw in the code that the link is dynamic, I mean that a couple of weeks ago it was https://betsapi.com/cin/soccer and now is https://betsapi.com/cip/soccer.

Looking on the code I would like to understand how to identify the current soccer link from this part of code.

JavaScript

Many thanks

Advertisement

Answer

I would just search through the card tab items and look for 'soccer'. Then print the href to get the link:

JavaScript

Output:

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