Skip to content

Instantly share code, notes, and snippets.

@gmariette
Created November 14, 2020 13:16
Show Gist options
  • Select an option

  • Save gmariette/e60199d44c1deb8cc8ca14683f3dc481 to your computer and use it in GitHub Desktop.

Select an option

Save gmariette/e60199d44c1deb8cc8ca14683f3dc481 to your computer and use it in GitHub Desktop.
def getPlayersFullName(playerUrl):
player_url = 'https://www.tennisexplorer.com'+ playerUrl
player_response = requests.get(player_url)
player_soup = BeautifulSoup(player_response.content, 'html.parser')
player_table = player_soup.find("table",{"class":"plDetail"})
player_table_body = player_table.find('tbody')
player_name = player_table_body.find_all('h3')
return ' '.join(player_name[0].text.split()[::-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment