This is my code:
div_tag = text.find_all("div", {"class": "team-name"})
teams = []
for a_finder in div_tag:
team_tags = a_finder.find_all("a")
for a_finder in team_tags:
teams.append(a_finder.get_text("\n", strip=True))
This is some of the output:
653
NOSIDE
Here is the HTML:
<div class="team-name">
<a href="/team/653/2020">653<br>NOSIDE</a>
</div>
The output is nice, but I would like to separate the team number and the team name into two separate lists. Ive been able to separate the text before and after the <br>
tag using the "\n", strip=True
params but I'm unsure how to actually separate the two into a list or var.
Any help would be quite nice.