网络抓取表元素

时间:2018-07-19 16:49:02

标签: python python-3.x beautifulsoup request

我目前正在尝试从espn网站上抓取2018年梦幻足球运动员排名并将该信息导入到csv文件中。目前,我的程序能够成功抓取,但它仅捕获我搜索过的每个类标签的第一个元素。我使用了soup.find_all('')方法,但是似乎仍然无法获得整个表格。这是我的代码。

from bs4 import BeautifulSoup
import requests

# pass in the url to be parsed
ff_rank_url = 'http://www.espn.com/fantasy/football/story/_/page/18RanksPreseason300PPR/2018-fantasy-football-ppr-rankings-top-300'

source = requests.get(ff_rank_url).text

# create parsed soup object
soup = BeautifulSoup(source, 'lxml')

# grab top 300 ppr rankings for 2018
ff_table = soup.find('aside')

# print(ff_table.prettify())
# grabbing players in that table

# players = ff_table.find('table', class_='inline-table').text
# print(players)

for player in soup.find_all('table', class_='inline-table'):
    players = player.tbody.tr.text
    print(players)

基本上,我怎样才能将这个确切的表放入python中?

2 个答案:

答案 0 :(得分:0)

这将使您从网站上获得漂亮的表格:

import requests
import pandas as pd

# pass in the url to be parsed
ff_rank_url = 'http://www.espn.com/fantasy/football/story/_/page/18RanksPreseason300PPR/2018-fantasy-football-ppr-rankings-top-300'

source = requests.get(ff_rank_url).text

table_1=pd.read_html(source)[0]
table_2=pd.read_html(source)[1]

第二张表具有混合等级,玩家可以一起删除,因为索引将成为等级。这行代码将解决这个问题。

table_2['Rank, Player'] = table_2['Rank, Player'].str.replace('\d+\.', '')
table_2.rename(columns={"Rank, Player": "Player"},inplace=True)

you will get a nice table that looks like this

答案 1 :(得分:0)

您可以找到外部表,然后刮取名称:

import requests, re
from bs4 import BeautifulSoup as soup
from collections import namedtuple
player = namedtuple('player', ['rank', 'name', 'position', 'team', 'posrank'])
d = soup(requests.get('http://www.espn.com/fantasy/football/story/_/page/18RanksPreseason300PPR/2018-fantasy-football-ppr-rankings-top-300').text, 'html.parser')
_, *data = [[i.text for i in c.find_all('td')] for c in d.find_all('aside', {'class':'inline inline-table'})[1].find('table').find_all('tr')]
parsed_result = [[*re.split('(?<=\d)\.\s', a), *d] for a, *d in data]
final_output = [player(*i) for i in parsed_result]

输出:

[player(rank='1', name="Le'Veon Bell", position='RB', team='PIT', posrank='RB1'), player(rank='2', name='Todd Gurley II', position='RB', team='LAR', posrank='RB2'), player(rank='3', name='David Johnson', position='RB', team='ARI', posrank='RB3'), player(rank='4', name='Antonio Brown', position='WR', team='PIT', posrank='WR1'), player(rank='5', name='Ezekiel Elliott', position='RB', team='DAL', posrank='RB4'), player(rank='6', name='Saquon Barkley', position='RB', team='NYG', posrank='RB5'), player(rank='7', name='Alvin Kamara', position='RB', team='NO', posrank='RB6'), player(rank='8', name='Julio Jones', position='WR', team='ATL', posrank='WR2'), player(rank='9', name='DeAndre Hopkins', position='WR', team='HOU', posrank='WR3'), player(rank='10', name='Odell Beckham Jr.', position='WR', team='NYG', posrank='WR4'), player(rank='11', name='Kareem Hunt', position='RB', team='KC', posrank='RB7'), player(rank='12', name='Keenan Allen', position='WR', team='LAC', posrank='WR5'), player(rank='13', name='Dalvin Cook', position='RB', team='MIN', posrank='RB8'), player(rank='14', name='Leonard Fournette', position='RB', team='JAC', posrank='RB9'), player(rank='15', name='Melvin Gordon', position='RB', team='LAC', posrank='RB10'), player(rank='16', name='Michael Thomas', position='WR', team='NO', posrank='WR6'), player(rank='17', name='A.J. Green', position='WR', team='CIN', posrank='WR7'), player(rank='18', name='LeSean McCoy', position='RB', team='BUF', posrank='RB11'), player(rank='19', name='Christian McCaffrey', position='RB', team='CAR', posrank='RB12'), player(rank='20', name='Devonta Freeman', position='RB', team='ATL', posrank='RB13'), player(rank='21', name='Davante Adams', position='WR', team='GB', posrank='WR8'), player(rank='22', name='Rob Gronkowski', position='TE', team='NE', posrank='TE1'), player(rank='23', name='Mike Evans', position='WR', team='TB', posrank='WR9'), player(rank='24', name='Adam Thielen', position='WR', team='MIN', posrank='WR10'), player(rank='25', name='Larry Fitzgerald', position='WR', team='ARI', posrank='WR11'), player(rank='26', name='T.Y. Hilton', position='WR', team='IND', posrank='WR12'), player(rank='27', name='Doug Baldwin', position='WR', team='SEA', posrank='WR13'), player(rank='28', name='Stefon Diggs', position='WR', team='MIN', posrank='WR14'), player(rank='29', name='Travis Kelce', position='TE', team='KC', posrank='TE2'), player(rank='30', name='Zach Ertz', position='TE', team='PHI', posrank='TE3'), player(rank='31', name='Tyreek Hill', position='WR', team='KC', posrank='WR15'), player(rank='32', name='Demaryius Thomas', position='WR', team='DEN', posrank='WR16'), player(rank='33', name='Allen Robinson', position='WR', team='CHI', posrank='WR17'), player(rank='34', name='Golden Tate', position='WR', team='DET', posrank='WR18'), player(rank='35', name='Josh Gordon', position='WR', team='CLE', posrank='WR19'), player(rank='36', name='Jerick McKinnon', position='RB', team='SF', posrank='RB14'), player(rank='37', name='Joe Mixon', position='RB', team='CIN', posrank='RB15'), player(rank='38', name='Jordan Howard', position='RB', team='CHI', posrank='RB16'), player(rank='39', name='Alshon Jeffery', position='WR', team='PHI', posrank='WR20'), player(rank='40', name='Amari Cooper', position='WR', team='OAK', posrank='WR21'), player(rank='41', name='JuJu Smith-Schuster', position='WR', team='PIT', posrank='WR22'), player(rank='42', name='Jarvis Landry', position='WR', team='CLE', posrank='WR23'), player(rank='43', name='Kenyan Drake', position='RB', team='MIA', posrank='RB17'), player(rank='44', name='Derrius Guice', position='RB', team='WAS', posrank='RB18'), player(rank='45', name='Royce Freeman', position='RB', team='DEN', posrank='RB19'), player(rank='46', name='Rashaad Penny', position='RB', team='SEA', posrank='RB20'), player(rank='47', name='Sony Michel', position='RB', team='NE', posrank='RB21'), player(rank='48', name='Ronald Jones II', position='RB', team='TB', posrank='RB22'), player(rank='49', name='Alex Collins', position='RB', team='BAL', posrank='RB23'), player(rank='50', name='Marshawn Lynch', position='RB', team='OAK', posrank='RB24'), player(rank='51', name='Marvin Jones Jr.', position='WR', team='DET', posrank='WR24'), player(rank='52', name='Robert Woods', position='WR', team='LAR', posrank='WR25'), player(rank='53', name='Emmanuel Sanders', position='WR', team='DEN', posrank='WR26'), player(rank='54', name='Michael Crabtree', position='WR', team='BAL', posrank='WR27'), player(rank='55', name='Jay Ajayi', position='RB', team='PHI', posrank='RB25'), player(rank='56', name='Derrick Henry', position='RB', team='TEN', posrank='RB26'), player(rank='57', name='Dion Lewis', position='RB', team='TEN', posrank='RB27'), player(rank='58', name='Mark Ingram', position='RB', team='NO', posrank='RB28'), player(rank='59', name='Duke Johnson Jr.', position='RB', team='CLE', posrank='RB29'), player(rank='60', name='Pierre Garcon', position='WR', team='SF', posrank='WR28'), player(rank='61', name='Chris Hogan', position='WR', team='NE', posrank='WR29'), player(rank='62', name='Brandin Cooks', position='WR', team='LAR', posrank='WR30'), player(rank='63', name='Corey Davis', position='WR', team='TEN', posrank='WR31'), player(rank='64', name='Aaron Rodgers', position='QB', team='GB', posrank='QB1'), player(rank='65', name='Tom Brady', position='QB', team='NE', posrank='QB2'), player(rank='66', name='Sammy Watkins', position='WR', team='KC', posrank='WR32'), player(rank='67', name='Randall Cobb', position='WR', team='GB', posrank='WR33'), player(rank='68', name='Devin Funchess', position='WR', team='CAR', posrank='WR34'), player(rank='69', name='Will Fuller V', position='WR', team='HOU', posrank='WR35'), player(rank='70', name='Cooper Kupp', position='WR', team='LAR', posrank='WR36'), player(rank='71', name='DeVante Parker', position='WR', team='MIA', posrank='WR37'), player(rank='72', name='Robby Anderson', position='WR', team='NYJ', posrank='WR38'), player(rank='73', name='Greg Olsen', position='TE', team='CAR', posrank='TE4'), player(rank='74', name='Delanie Walker', position='TE', team='TEN', posrank='TE5'), player(rank='75', name='Evan Engram', position='TE', team='NYG', posrank='TE6'), player(rank='76', name='Lamar Miller', position='RB', team='HOU', posrank='RB30'), player(rank='77', name='Julian Edelman', position='WR', team='NE', posrank='WR39'), player(rank='78', name='Kelvin Benjamin', position='WR', team='BUF', posrank='WR40'), player(rank='79', name='Kerryon Johnson', position='RB', team='DET', posrank='RB31'), player(rank='80', name='Cam Newton', position='QB', team='CAR', posrank='QB3'), player(rank='81', name='Carson Wentz', position='QB', team='PHI', posrank='QB4'), player(rank='82', name='Russell Wilson', position='QB', team='SEA', posrank='QB5'), player(rank='83', name='Deshaun Watson', position='QB', team='HOU', posrank='QB6'), player(rank='84', name='Jordan Reed', position='TE', team='WAS', posrank='TE7'), player(rank='85', name='Tevin Coleman', position='RB', team='ATL', posrank='RB32'), player(rank='86', name='Tarik Cohen', position='RB', team='CHI', posrank='RB33'), player(rank='87', name='Chris Thompson', position='RB', team='WAS', posrank='RB34'), player(rank='88', name='Jamison Crowder', position='WR', team='WAS', posrank='WR41'), player(rank='89', name='DeSean Jackson', position='WR', team='TB', posrank='WR42'), player(rank='90', name='Jimmy Graham', position='TE', team='GB', posrank='TE8'), player(rank='91', name='Jordy Nelson', position='WR', team='OAK', posrank='WR43'), player(rank='92', name='Marquise Goodwin', position='WR', team='SF', posrank='WR44'), player(rank='93', name='Dez Bryant', position='WR', team='FA', posrank='WR45'), player(rank='94', name='Marlon Mack', position='RB', team='IND', posrank='RB35'), player(rank='95', name='Jamaal Williams', position='RB', team='GB', posrank='RB36'), player(rank='96', name='Isaiah Crowell', position='RB', team='NYJ', posrank='RB37'), player(rank='97', name='Rex Burkhead', position='RB', team='NE', posrank='RB38'), player(rank='98', name="D'Onta Foreman", position='RB', team='HOU', posrank='RB39'), player(rank='99', name='Kyle Rudolph', position='TE', team='MIN', posrank='TE9'), player(rank='100', name='Ty Montgomery', position='RB', team='GB', posrank='RB40'), player(rank='101', name='Marqise Lee', position='WR', team='JAC', posrank='WR46'), player(rank='102', name='Josh Doctson', position='WR', team='WAS', posrank='WR47'), player(rank='103', name='Kenny Stills', position='WR', team='MIA', posrank='WR48'), player(rank='104', name='Sterling Shepard', position='WR', team='NYG', posrank='WR49'), player(rank='105', name='Nelson Agholor', position='WR', team='PHI', posrank='WR50'), player(rank='106', name='Rishard Matthews', position='WR', team='TEN', posrank='WR51'), player(rank='107', name='Nick Chubb', position='RB', team='CLE', posrank='RB41'), player(rank='108', name='Carlos Hyde', position='RB', team='CLE', posrank='RB42'), player(rank='109', name='Giovani Bernard', position='RB', team='CIN', posrank='RB43'), player(rank='110', name='Jack Doyle', position='TE', team='IND', posrank='TE10'), player(rank='111', name='Trey Burton', position='TE', team='CHI', posrank='TE11'), player(rank='112', name='Devontae Booker', position='RB', team='DEN', posrank='RB44'), player(rank='113', name='Theo Riddick', position='RB', team='DET', posrank='RB45'), player(rank='114', name='James White', position='RB', team='NE', posrank='RB46'), player(rank='115', name='Allen Hurns', position='WR', team='DAL', posrank='WR52'), player(rank='116', name='Paul Richardson', position='WR', team='WAS', posrank='WR53'), player(rank='117', name='Ben Roethlisberger', position='QB', team='PIT', posrank='QB7'), player(rank='118', name='Kirk Cousins', position='QB', team='MIN', posrank='QB8'), player(rank='119', name='Andrew Luck', position='QB', team='IND', posrank='QB9'), player(rank='120', name='Tyler Eifert', position='TE', team='CIN', posrank='TE12'), player(rank='121', name='Kenny Golladay', position='WR', team='DET', posrank='WR54'), player(rank='122', name='Mohamed Sanu', position='WR', team='ATL', posrank='WR55'), player(rank='123', name='D.J. Moore', position='WR', team='CAR', posrank='WR56'), player(rank='124', name='Tyler Lockett', position='WR', team='SEA', posrank='WR57'), player(rank='125', name='Calvin Ridley', position='WR', team='ATL', posrank='WR58'), player(rank='126', name='Michael Gallup', position='WR', team='DAL', posrank='WR59'), player(rank='127', name='Matthew Stafford', position='QB', team='DET', posrank='QB10'), player(rank='128', name='Drew Brees', position='QB', team='NO', posrank='QB11'), player(rank='129', name='Cameron Meredith', position='WR', team='NO', posrank='WR60'), player(rank='130', name='Jordan Matthews', position='WR', team='NE', posrank='WR61'), player(rank='131', name='John Ross', position='WR', team='CIN', posrank='WR62'), player(rank='132', name='Martavis Bryant', position='WR', team='OAK', posrank='WR63'), player(rank='133', name='Anthony Miller', position='WR', team='CHI', posrank='WR64'), player(rank='134', name='Christian Kirk', position='WR', team='ARI', posrank='WR65'), player(rank='135', name='Albert Wilson', position='WR', team='MIA', posrank='WR66'), player(rank='136', name='Zay Jones', position='WR', team='BUF', posrank='WR67'), player(rank='137', name='James Washington', position='WR', team='PIT', posrank='WR68'), player(rank='138', name='Mike Williams', position='WR', team='LAC', posrank='WR69'), player(rank='139', name='Aaron Jones', position='RB', team='GB', posrank='RB47'), player(rank='140', name='Kenneth Dixon', position='RB', team='BAL', posrank='RB48'), player(rank='141', name='Charles Clay', position='TE', team='BUF', posrank='TE13'), player(rank='142', name='Philip Rivers', position='QB', team='LAC', posrank='QB12'), player(rank='143', name='Patrick Mahomes', position='QB', team='KC', posrank='QB13'), player(rank='144', name='Jordan Wilkins', position='RB', team='IND', posrank='RB49'), player(rank='145', name='C.J. Anderson', position='RB', team='CAR', posrank='RB50'), player(rank='146', name='Elijah McGuire', position='RB', team='NYJ', posrank='RB51'), player(rank='147', name='David Njoku', position='TE', team='CLE', posrank='TE14'), player(rank='148', name='Jimmy Garoppolo', position='QB', team='SF', posrank='QB14'), player(rank='149', name='Alex Smith', position='QB', team='WAS', posrank='QB15'), player(rank='150', name='Latavius Murray', position='RB', team='MIN', posrank='RB52'), player(rank='151', name='Chris Carson', position='RB', team='SEA', posrank='RB53'), player(rank='152', name='Nyheim Hines', position='RB', team='IND', posrank='RB54'), player(rank='153', name='Matt Breida', position='RB', team='SF', posrank='RB55'), player(rank='154', name='Jaguars D/ST', position='DST', team='JAC', posrank='DST1'), player(rank='155', name='Cameron Brate', position='TE', team='TB', posrank='TE15'), player(rank='156', name='Donte Moncrief', position='WR', team='JAC', posrank='WR70'), player(rank='157', name='Mike Wallace', position='WR', team='PHI', posrank='WR71'), player(rank='158', name='Terrelle Pryor Sr.', position='WR', team='NYJ', posrank='WR72'), player(rank='159', name='Doug Martin', position='RB', team='OAK', posrank='RB56'), player(rank='160', name='Matt Ryan', position='QB', team='ATL', posrank='QB16'), player(rank='161', name='Marcus Mariota', position='QB', team='TEN', posrank='QB17'), player(rank='162', name='Dak Prescott', position='QB', team='DAL', posrank='QB18'), player(rank='163', name='Jared Goff', position='QB', team='LAR', posrank='QB19'), player(rank='164', name='George Kittle', position='TE', team='SF', posrank='TE16'), player(rank='165', name='Chris Godwin', position='WR', team='TB', posrank='WR73'), player(rank='166', name='Austin Seferian-Jenkins', position='TE', team='JAC', posrank='TE17'), player(rank='167', name='LeGarrette Blount', position='RB', team='DET', posrank='RB57'), player(rank='168', name='Mitchell Trubisky', position='QB', team='CHI', posrank='QB20'), player(rank='169', name='Ted Ginn Jr.', position='WR', team='NO', posrank='WR74'), player(rank='170', name='Eagles D/ST', position='DST', team='PHI', posrank='DST2'), player(rank='171', name='Rams D/ST', position='DST', team='LAR', posrank='DST3'), player(rank='172', name='Vikings D/ST', position='DST', team='MIN', posrank='DST4'), player(rank='173', name='Texans D/ST', position='DST', team='BAL', posrank='DST5'), player(rank='174', name='Ravens D/ST', position='DST', team='HOU', posrank='DST6'), player(rank='175', name='Greg Zuerlein', position='K', team='LAR', posrank='K1'), player(rank='176', name='Stephen Gostkowski', position='K', team='NE', posrank='K2'), player(rank='177', name='Justin Tucker', position='K', team='BAL', posrank='K3'), player(rank='178', name='Patriots D/ST', position='DST', team='NE', posrank='DST7'), player(rank='179', name='Chargers D/ST', position='DST', team='LAC', posrank='DST8'), player(rank='180', name='Broncos D/ST', position='DST', team='DEN', posrank='DST9'), player(rank='181', name='Panthers D/ST', position='DST', team='CAR', posrank='DST10'), player(rank='182', name='Saints D/ST', position='DST', team='NO', posrank='DST11'), player(rank='183', name='Titans D/ST', position='DST', team='TEN', posrank='DST12'), player(rank='184', name='Matt Bryant', position='K', team='ATL', posrank='K4'), player(rank='185', name='Wil Lutz', position='K', team='NO', posrank='K5'), player(rank='186', name='Chris Boswell', position='K', team='PIT', posrank='K6'), player(rank='187', name='Robbie Gould', position='K', team='SF', posrank='K7'), player(rank='188', name='Jake Elliott', position='K', team='PHI', posrank='K8'), player(rank='189', name='Matt Prater', position='K', team='DET', posrank='K9'), player(rank='190', name='Harrison Butker', position='K', team='KC', posrank='K10'), player(rank='191', name='Adam Vinatieri', position='K', team='IND', posrank='K11'), player(rank='192', name='Graham Gano', position='K', team='CAR', posrank='K12'), player(rank='193', name='Bilal Powell', position='RB', team='NYJ', posrank='RB58'), player(rank='194', name='Peyton Barber', position='RB', team='TB', posrank='RB59'), player(rank='195', name='Chris Ivory', position='RB', team='BUF', posrank='RB60'), player(rank='196', name='Benjamin Watson', position='TE', team='NO', posrank='TE18'), player(rank='197', name='Vance McDonald', position='TE', team='PIT', posrank='TE19'), player(rank='198', name='Jared Cook', position='TE', team='OAK', posrank='TE20'), player(rank='199', name='Darren Sproles', position='RB', team='PHI', posrank='RB61'), player(rank='200', name='Austin Ekeler', position='RB', team='LAC', posrank='RB62'), player(rank='201', name='Corey Clement', position='RB', team='PHI', posrank='RB63'), player(rank='202', name='Spencer Ware', position='RB', team='KC', posrank='RB64'), player(rank='203', name='Chase Edmonds', position='RB', team='ARI', posrank='RB65'), player(rank='204', name='Frank Gore', position='RB', team='MIA', posrank='RB66'), player(rank='205', name='John Kelly', position='RB', team='LAR', posrank='RB67'), player(rank='206', name='Jonathan Stewart', position='RB', team='NYG', posrank='RB68'), player(rank='207', name='Javorius Allen', position='RB', team='BAL', posrank='RB69'), player(rank='208', name='T.J. Yeldon', position='RB', team='JAC', posrank='RB70'), player(rank='209', name='Mark Walton', position='RB', team='CIN', posrank='RB71'), player(rank='210', name='Eric Ebron', position='TE', team='IND', posrank='TE21'), player(rank='211', name='O.J. Howard', position='TE', team='TB', posrank='TE22'), player(rank='212', name='Tyrod Taylor', position='QB', team='CLE', posrank='QB21'), player(rank='213', name='Terrance Williams', position='WR', team='DAL', posrank='WR75'), player(rank='214', name='Danny Amendola', position='WR', team='MIA', posrank='WR76'), player(rank='215', name='Brandon Marshall', position='WR', team='SEA', posrank='WR77'), player(rank='216', name='John Brown', position='WR', team='BAL', posrank='WR78'), player(rank='217', name='Willie Snead', position='WR', team='BAL', posrank='WR79'), player(rank='218', name='Dede Westbrook', position='WR', team='JAC', posrank='WR80'), player(rank='219', name='Andy Dalton', position='QB', team='CIN', posrank='QB22'), player(rank='220', name='Ryan Tannehill', position='QB', team='MIA', posrank='QB23'), player(rank='221', name='Redskins D/ST', position='DST', team='WAS', posrank='DST13'), player(rank='222', name='Cardinals D/ST', position='DST', team='ARI', posrank='DST14'), player(rank='223', name='Dan Bailey', position='K', team='DAL', posrank='K13'), player(rank='224', name='Ryan Succop', position='K', team='TEN', posrank='K14'), player(rank='225', name='Tyrell Williams', position='WR', team='LAC', posrank='WR81'), player(rank='226', name='Ryan Grant', position='WR', team='IND', posrank='WR82'), player(rank='227', name='Quincy Enunwa', position='WR', team='NYJ', posrank='WR83'), player(rank='228', name='Jermaine Kearse', position='WR', team='NYJ', posrank='WR84'), player(rank='229', name='Taywan Taylor', position='WR', team='TEN', posrank='WR85'), player(rank='230', name='Courtland Sutton', position='WR', team='DEN', posrank='WR86'), player(rank='231', name='D.J. Chark', position='WR', team='JAC', posrank='WR87'), player(rank='232', name='Curtis Samuel', position='WR', team='CAR', posrank='WR88'), player(rank='233', name='Brandon LaFell', position='WR', team='CIN', posrank='WR89'), player(rank='234', name='Kendall Wright', position='WR', team='MIN', posrank='WR90'), player(rank='235', name='Charles Sims', position='RB', team='TB', posrank='RB72'), player(rank='236', name='Corey Grant', position='RB', team='JAC', posrank='RB73'), player(rank='237', name='Tavon Austin', position='RB', team='DAL', posrank='RB74'), player(rank='238', name="De'Angelo Henderson", position='RB', team='DEN', posrank='RB75'), player(rank='239', name='Wayne Gallman', position='RB', team='NYG', posrank='RB76'), player(rank='240', name='Terrance West', position='RB', team='NO', posrank='RB77'), player(rank='241', name='Jaylen Samuels', position='RB', team='PIT', posrank='RB78'), player(rank='242', name='Kalen Ballage', position='RB', team='MIA', posrank='RB79'), player(rank='243', name='Eli Manning', position='QB', team='NYG', posrank='QB24'), player(rank='244', name='Jameis Winston', position='QB', team='TB', posrank='QB25'), player(rank='245', name='Derek Carr', position='QB', team='OAK', posrank='QB26'), player(rank='246', name='Mike Gesicki', position='TE', team='MIA', posrank='TE23'), player(rank='247', name='Austin Hooper', position='TE', team='ATL', posrank='TE24'), player(rank='248', name='Ricky Seals-Jones', position='TE', team='ARI', posrank='TE25'), player(rank='249', name='Ryan Griffin', position='TE', team='HOU', posrank='TE26'), player(rank='250', name='C.J. Prosise', position='RB', team='SEA', posrank='RB80'), player(rank='251', name='Keke Coutee', position='WR', team='HOU', posrank='WR91'), player(rank='252', name='Taylor Gabriel', position='WR', team='CHI', posrank='WR92'), player(rank='253', name='Cowboys D/ST', position='DST', team='DAL', posrank='DST15'), player(rank='254', name='Seahawks D/ST', position='DST', team='SEA', posrank='DST16'), player(rank='255', name='Daniel Carlson', position='K', team='MIN', posrank='K15'), player(rank='256', name='Josh Lambo', position='K', team='JAC', posrank='K16'), player(rank='257', name='Hayden Hurst', position='TE', team='BAL', posrank='TE27'), player(rank='258', name='Gerald Everett', position='TE', team='LAR', posrank='TE28'), player(rank='259', name='Jake Butt', position='TE', team='DEN', posrank='TE29'), player(rank='260', name='Deon Cain', position='WR', team='IND', posrank='WR93'), player(rank='261', name='Trent Taylor', position='WR', team='SF', posrank='WR94'), player(rank='262', name='Travis Benjamin', position='WR', team='LAC', posrank='WR95'), player(rank='263', name='Geronimo Allison', position='WR', team='GB', posrank='WR96'), player(rank='264', name='Joe Williams', position='RB', team='SF', posrank='RB81'), player(rank='265', name='Alfred Blue', position='RB', team='HOU', posrank='RB82'), player(rank='266', name='Case Keenum', position='QB', team='DEN', posrank='QB27'), player(rank='267', name='Blake Bortles', position='QB', team='JAC', posrank='QB28'), player(rank='268', name='Joe Flacco', position='QB', team='BAL', posrank='QB29'), player(rank='269', name='Sam Bradford', position='QB', team='ARI', posrank='QB30'), player(rank='270', name='Josh McCown', position='QB', team='NYJ', posrank='QB31'), player(rank='271', name='Adam Humphries', position='WR', team='TB', posrank='WR97'), player(rank='272', name='Cole Beasley', position='WR', team='DAL', posrank='WR98'), player(rank='273', name='J.J. Nelson', position='WR', team='ARI', posrank='WR99'), player(rank='274', name='DaeSean Hamilton', position='WR', team='DEN', posrank='WR100'), player(rank='275', name='Dante Pettis', position='WR', team='SF', posrank='WR101'), player(rank='276', name='Boston Scott', position='RB', team='NO', posrank='RB83'), player(rank='277', name='Damien Williams', position='RB', team='KC', posrank='RB84'), player(rank='278', name='T.J. Logan', position='RB', team='ARI', posrank='RB85'), player(rank='279', name='Mike Gillislee', position='RB', team='NE', posrank='RB86'), player(rank='280', name='Justin Jackson', position='RB', team='LAC', posrank='RB87'), player(rank='281', name='Jeremy Hill', position='RB', team='NE', posrank='RB88'), player(rank='282', name='J.D. McKissic', position='RB', team='SEA', posrank='RB89'), player(rank='283', name='Robert Turbin', position='RB', team='IND', posrank='RB90'), player(rank='284', name='Amara Darboh', position='WR', team='SEA', posrank='WR102'), player(rank='285', name='Lions D/ST', position='DST', team='DET', posrank='DST17'), player(rank='286', name='Falcons D/ST', position='DST', team='ATL', posrank='DST18'), player(rank='287', name="Ka'imi Fairbairn", position='K', team='HOU', posrank='K17'), player(rank='288', name='Mason Crosby', position='K', team='GB', posrank='K18'), player(rank='289', name='Antonio Gates', position='TE', team='FA', posrank='TE30'), player(rank='290', name='Rico Gathers', position='TE', team='DAL', posrank='TE31'), player(rank='291', name='Blake Jarwin', position='TE', team='DAL', posrank='TE32'), player(rank='292', name='Luke Willson', position='TE', team='DET', posrank='TE33'), player(rank='293', name='Nick Vannett', position='TE', team='SEA', posrank='TE34'), player(rank='294', name='Corey Coleman', position='WR', team='CLE', posrank='WR103'), player(rank='295', name='Keelan Cole', position='WR', team='JAC', posrank='WR104'), player(rank='296', name='AJ McCarron', position='QB', team='BUF', posrank='QB32'), player(rank='297', name='Bears D/ST', position='DST', team='CHI', posrank='DST19'), player(rank='298', name='Steelers D/ST', position='DST', team='PIT', posrank='DST20'), player(rank='299', name='Browns D/ST', position='DST', team='CLE', posrank='DST21'), player(rank='300', name='Bengals D/ST', position='DST', team='CIN', posrank='DST22')]

输出(无namedtuple

[['1', "Le'Veon Bell", 'RB', 'PIT', 'RB1'], ['2', 'Todd Gurley II', 'RB', 'LAR', 'RB2'], ['3', 'David Johnson', 'RB', 'ARI', 'RB3'], ['4', 'Antonio Brown', 'WR', 'PIT', 'WR1'], ['5', 'Ezekiel Elliott', 'RB', 'DAL', 'RB4'], ['6', 'Saquon Barkley', 'RB', 'NYG', 'RB5'], ['7', 'Alvin Kamara', 'RB', 'NO', 'RB6'], ['8', 'Julio Jones', 'WR', 'ATL', 'WR2'], ['9', 'DeAndre Hopkins', 'WR', 'HOU', 'WR3'], ['10', 'Odell Beckham Jr.', 'WR', 'NYG', 'WR4'], ['11', 'Kareem Hunt', 'RB', 'KC', 'RB7'], ['12', 'Keenan Allen', 'WR', 'LAC', 'WR5'], ['13', 'Dalvin Cook', 'RB', 'MIN', 'RB8'], ['14', 'Leonard Fournette', 'RB', 'JAC', 'RB9'], ['15', 'Melvin Gordon', 'RB', 'LAC', 'RB10'], ['16', 'Michael Thomas', 'WR', 'NO', 'WR6'], ['17', 'A.J. Green', 'WR', 'CIN', 'WR7'], ['18', 'LeSean McCoy', 'RB', 'BUF', 'RB11'], ['19', 'Christian McCaffrey', 'RB', 'CAR', 'RB12'], ['20', 'Devonta Freeman', 'RB', 'ATL', 'RB13'], ['21', 'Davante Adams', 'WR', 'GB', 'WR8'], ['22', 'Rob Gronkowski', 'TE', 'NE', 'TE1'], ['23', 'Mike Evans', 'WR', 'TB', 'WR9'], ['24', 'Adam Thielen', 'WR', 'MIN', 'WR10'], ['25', 'Larry Fitzgerald', 'WR', 'ARI', 'WR11'], ['26', 'T.Y. Hilton', 'WR', 'IND', 'WR12'], ['27', 'Doug Baldwin', 'WR', 'SEA', 'WR13'], ['28', 'Stefon Diggs', 'WR', 'MIN', 'WR14'], ['29', 'Travis Kelce', 'TE', 'KC', 'TE2'], ['30', 'Zach Ertz', 'TE', 'PHI', 'TE3'], ['31', 'Tyreek Hill', 'WR', 'KC', 'WR15'], ['32', 'Demaryius Thomas', 'WR', 'DEN', 'WR16'], ['33', 'Allen Robinson', 'WR', 'CHI', 'WR17'], ['34', 'Golden Tate', 'WR', 'DET', 'WR18'], ['35', 'Josh Gordon', 'WR', 'CLE', 'WR19'], ['36', 'Jerick McKinnon', 'RB', 'SF', 'RB14'], ['37', 'Joe Mixon', 'RB', 'CIN', 'RB15'], ['38', 'Jordan Howard', 'RB', 'CHI', 'RB16'], ['39', 'Alshon Jeffery', 'WR', 'PHI', 'WR20'], ['40', 'Amari Cooper', 'WR', 'OAK', 'WR21'], ['41', 'JuJu Smith-Schuster', 'WR', 'PIT', 'WR22'], ['42', 'Jarvis Landry', 'WR', 'CLE', 'WR23'], ['43', 'Kenyan Drake', 'RB', 'MIA', 'RB17'], ['44', 'Derrius Guice', 'RB', 'WAS', 'RB18'], ['45', 'Royce Freeman', 'RB', 'DEN', 'RB19'], ['46', 'Rashaad Penny', 'RB', 'SEA', 'RB20'], ['47', 'Sony Michel', 'RB', 'NE', 'RB21'], ['48', 'Ronald Jones II', 'RB', 'TB', 'RB22'], ['49', 'Alex Collins', 'RB', 'BAL', 'RB23'], ['50', 'Marshawn Lynch', 'RB', 'OAK', 'RB24'], ['51', 'Marvin Jones Jr.', 'WR', 'DET', 'WR24'], ['52', 'Robert Woods', 'WR', 'LAR', 'WR25'], ['53', 'Emmanuel Sanders', 'WR', 'DEN', 'WR26'], ['54', 'Michael Crabtree', 'WR', 'BAL', 'WR27'], ['55', 'Jay Ajayi', 'RB', 'PHI', 'RB25'], ['56', 'Derrick Henry', 'RB', 'TEN', 'RB26'], ['57', 'Dion Lewis', 'RB', 'TEN', 'RB27'], ['58', 'Mark Ingram', 'RB', 'NO', 'RB28'], ['59', 'Duke Johnson Jr.', 'RB', 'CLE', 'RB29'], ['60', 'Pierre Garcon', 'WR', 'SF', 'WR28'], ['61', 'Chris Hogan', 'WR', 'NE', 'WR29'], ['62', 'Brandin Cooks', 'WR', 'LAR', 'WR30'], ['63', 'Corey Davis', 'WR', 'TEN', 'WR31'], ['64', 'Aaron Rodgers', 'QB', 'GB', 'QB1'], ['65', 'Tom Brady', 'QB', 'NE', 'QB2'], ['66', 'Sammy Watkins', 'WR', 'KC', 'WR32'], ['67', 'Randall Cobb', 'WR', 'GB', 'WR33'], ['68', 'Devin Funchess', 'WR', 'CAR', 'WR34'], ['69', 'Will Fuller V', 'WR', 'HOU', 'WR35'], ['70', 'Cooper Kupp', 'WR', 'LAR', 'WR36'], ['71', 'DeVante Parker', 'WR', 'MIA', 'WR37'], ['72', 'Robby Anderson', 'WR', 'NYJ', 'WR38'], ['73', 'Greg Olsen', 'TE', 'CAR', 'TE4'], ['74', 'Delanie Walker', 'TE', 'TEN', 'TE5'], ['75', 'Evan Engram', 'TE', 'NYG', 'TE6'], ['76', 'Lamar Miller', 'RB', 'HOU', 'RB30'], ['77', 'Julian Edelman', 'WR', 'NE', 'WR39'], ['78', 'Kelvin Benjamin', 'WR', 'BUF', 'WR40'], ['79', 'Kerryon Johnson', 'RB', 'DET', 'RB31'], ['80', 'Cam Newton', 'QB', 'CAR', 'QB3']