Ok, I have gotten a long way in the past 24 hours thanks to YouTube. I am stuck trying to find a solution to my current issue. I am trying to find text after certain text in the HTML file. Not particularly after a tag because these websites populate the same way for every game. so for example, the tag I first search is <span class="KambiBC-mod-outcome__odds">. But that is the same for every bet that they have on a particular game. Using find_all and len() there are anywhere from 120 to 150 instances. The first two are important to me, but the other two that I need will be a variable amount further away. I am hoping to truncate the string into two sections or just remove the first part after I extracted my data and then move onto the second part. Split doesn't seem to work with the large string that I have. I am looking for all HTML after the world "Halftime" because once again I would find the first two elements using find_all. Or if there is any other solution that you can think of. To visualize code because my explanation isn't the clearest:
Sugarhouse_Line = Sugarhouse.find_all(class_='KambiBC-mod-outcome__odds')
Sugarhouse_Line items 0 and 1 are vital to me, the other parts are somewhere between 60 and 80 but change every game and will change throughout the game, the only other constant that I can find would be anything after the word Halftime, so I would either want to truncate to remove everything before the word Halftime or do a find_all after the word Halftime.
Sugarhouse_Line = Sugarhouse.find_all(class_='KambiBC-mod-outcome__odds')
Sugarhouse_Line items 0 and 1 are vital to me, the other parts are somewhere between 60 and 80 but change every game and will change throughout the game, the only other constant that I can find would be anything after the word Halftime, so I would either want to truncate to remove everything before the word Halftime or do a find_all after the word Halftime.