fantasy icon indicating copy to clipboard operation
fantasy copied to clipboard

Error message when trying to scrape lineup

Open barapa opened this issue 10 years ago • 1 comments

I tried to scrape the lineup, but the elements the code is looking for are not found. I am guessing it is because there is no code for authentication. Is this being added or is there a way to authenticate?

Error: /Users/brapaport/development/fantasy/fantasy/lineup.py in scrape(league_id, team_id, year) 35 content = requests.get(url).content 36 soup = BeautifulSoup(content) ---> 37 return _get_players(soup) 38 39

/Users/brapaport/development/fantasy/fantasy/lineup.py in _get_players(soup) 69 # Get all the rows in the player table 70 table = soup.find('table', 'playerTableTable') ---> 71 rows = table.find_all('tr') 72 players = [] 73 # Grab all the headers so we can match stats to names

AttributeError: 'NoneType' object has no attribute 'find_all'

barapa avatar Oct 15 '14 12:10 barapa

I'm not sure how I can handle authentication. It's something I'll need to look into (and PRs are welcome!!).

Also I'll make the requirement to have a public league explicit in the readme.

joshgachnang avatar Oct 16 '14 17:10 joshgachnang