roclark / sportsipy

A free sports API written for python
MIT License
482 stars 188 forks source link

NCAAF Receiving Yards #418

Open enachmany opened 4 years ago

enachmany commented 4 years ago

It seems that the API cannot pull receiving yards for wide receivers.

roclark commented 3 years ago

Hey @enachmany, I apologize this is very overdue, but can you provide some additional information on the issue you are seeing if you are still running into this? I am not able to reproduce on my end:

from sportsreference.ncaaf.roster import Player

harris = Player('najee-harris-1')
print(harris.receiving_yards)
# 432

If you are seeing something in particular, I would be happy to create a fix for it!

enachmany commented 3 years ago

Hi @roclark and thank you so much for getting back to me. For some reason it is not working for receivers when I try to loop through team rosters. As an example:

from sportsreference.ncaaf.roster import Roster

y=['oklahoma']

print('Players:')
for i in y:
    b12 = Roster(i)
    x=i
    try:
        x=i.replace('-',' ')
    except:
        x=i.title()
    x=x.title()
    for player in b12.players:
        if player.receiving_yards is None:
            continue
        elif player.receiving_yards <50:
            continue
        else:
            print(player.height,player.weight,x,player.year,player.position,player.name,':',player.receiving_yards)

# Players:
# 5-9 193 Oklahoma  RB T.J. Pledger : 90
# 5-11 211 Oklahoma  RB Seth McGowan : 79
# 5-11 214 Oklahoma SO RB Kennedy Brooks : 136
# 6-0 246 Oklahoma JR RB Rhamondre Stevenson : 87

What am I doing wrong? The receivers are not coming up.