Skip to content

Player Bio #8

@audas

Description

@audas

Not really sure how to go about making changes - but it would be great if we could get player stats to include player bio so we can have their date of birth etc. If we get it as a timestamp then we can also use it as useable data, same for height and weight.
Something like this? Sorry if this is not the way of going about things.

`

  player_bio={}
    for i in soup.find_all('b'):
        if(re.sub(r"[\n\t\s]*", "", i.get_text())=="Born:"):
            player_bio["dob"]=re.sub(r"[\n\t\s]*", "", i.next_sibling.replace(" (",""))    
            timestamp = (datetime.strptime(player_bio["dob"], '%d-%b-%Y') - datetime(1970, 1, 1)).total_seconds()
            player_bio["timestamp"]=timestamp
        if(re.sub(r"[\n\t\s]*", "", i.get_text())=="Height:"):
            player_bio["height"]=re.sub("[^0-9]", "",i.next_sibling)
        if(re.sub(r"[\n\t\s]*", "", i.get_text())=="Weight:"):
            player_bio["weight"]=re.sub("[^0-9]", "",i.next_sibling) `

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions