I am web scraping a page with a list of e-sport matches : https://www.over.gg/matches
As you can see, the name of the tournament is repeated on each line. In my code, a tournament is its own class, made of several attributes that are created on the fly and a name.
The idea is that, for a given line/match, I want to check if there is already an instance of the tournament class created in the scope (by checking the name attribute), so I do not create a new tournament object for each match. Instead I only "attach" the match to the already existing tournament.
I can manually create a list of each object I create during the execution and check each time if the object already exists, but I wonder if there is a built-in and more smart way of doing that.
It's like checking in a DB if there is already a record with the same primary key to avoid creating a new one. I found some leads but it's not explicitly about my issue.