I'm trying to pull some text from a website called Elite Prospects (https://www.eliteprospects.com/team/41/jokerit). Here is the source code from the page:
<div class="semi-logo">
    Jokerit
            <small>
            <span>
                <i> <img class="nation-flag" src="//files.eliteprospects.com/layout/flagsmedium/9.png"> </i>
                <a href="https://www.eliteprospects.com/league/khl">KHL</a>
            </span>
        </small>
    </div>            
I'm specifically trying to pull the team name (in this example it is "Jokerit"), and the league name located in the a href tag. I'm successfull able to pull the league name, but the way I am trying to pull the team name gives me "JokeritKHL". I'm using this code for multiple examples so it needs to be able to pull a two worded team name as well (for example "Guelph Storm").
Here is my code:
team_logo= scraper.find(class_='semi-logo')
team_name = team_logo.getText(strip=True)
league = team_logo.find('a')
league = league.getText()
print(league)
print(team_name)
And here is the current output I'm getting:
KHL
JokeritKHL
Any ideas?
What I'm trying to find out is there a way to only get the "Jokerit" part
 
     
     
    