Python 我想从使用Beautifulsoup或任何有效的网页表中进行刮取。

Python 我想从使用Beautifulsoup或任何有效的网页表中进行刮取。,python,web-scraping,html-table,beautifulsoup,Python,Web Scraping,Html Table,Beautifulsoup,我正在尝试从stitcher网站上获取前100名播客的名单: 它是一个表,但实际的表隐藏在许多其他格式约束中 我尝试过使用BeautifulSoup和其他一些方法。我似乎总是能看穿html的一些嵌套层,但一旦我到达带有表的层,它就不会输出任何内容。我觉得我好像错过了什么 url = requests.get('https://www.stitcher.com/stitcher-list/all-podcasts-top-shows') html_soup = BeautifulSoup(url

我正在尝试从stitcher网站上获取前100名播客的名单:

它是一个表,但实际的表隐藏在许多其他格式约束中

我尝试过使用BeautifulSoup和其他一些方法。我似乎总是能看穿html的一些嵌套层,但一旦我到达带有表的层,它就不会输出任何内容。我觉得我好像错过了什么

url = requests.get('https://www.stitcher.com/stitcher-list/all-podcasts-top-shows')
html_soup = BeautifulSoup(url.text, 'html.parser')
html_soup.findAll('table')[0].findAll('tr')

该站点似乎是动态的,因为在一个简单的
请求之后,对
id
'sticker-list'
(包含播客)的表进行检查。get
调用生成未填充的
。因此,您必须使用浏览器操作工具,例如:

输出:

[['1', 'My Favorite Murder with Karen Kilgari...', 'Comedy', '-'], ['2', 'True Crime Garage', 'Society & Culture', '+3'], ['3', 'Serial', 'Society & Culture', '-'], ['4', 'The Joe Rogan Experience', 'Comedy', '-2'], ['5', 'Fantasy Football Today Podcast', 'Sports', '+1'], ['6', 'This American Life', 'Society & Culture', '+1'], ['7', 'Dr. Death', 'Science & Medicine', '-3'], ['8', 'The Rachel Maddow Show', 'News & Politics', '-'], ['9', 'The Daily', 'News & Politics', '-'], ['10', 'Sword and Scale', 'Society & Culture', '+4'], ['11', 'Last Podcast On The Left', 'Pop Culture, TV & Film', '-1'], ['12', 'Freakonomics Radio', 'Society & Culture', '-'], ['13', 'Radiolab', 'Science & Medicine', '+4'], ['14', 'Casefile True Crime', 'Pop Culture, TV & Film', '-3'], ['15', 'Pod Save America', 'News & Politics', '-2'], ['16', 'Spittin Chiclets', 'Sports', '+2'], ['17', 'Stuff You Should Know', 'Education', '-1'], ['18', 'Planet Money', 'Business', '-3'], ['19', 'Pardon My Take', 'Sports', '+4'], ['20', 'The Dream', 'Society & Culture', '+9'], ['21', 'Lore', 'Society & Culture', '+14'], ['22', 'Up and Vanished', 'News & Politics', '-1'], ['23', 'Hidden Brain', 'Science & Medicine', '-1'], ['24', '99% Invisible', 'Society & Culture', '-4'], ['25', 'Fresh Air', 'Society & Culture', '-1'], ['26', 'TED Radio Hour', 'Society & Culture', '+1'], ['27', "Wait Wait...Don't Tell Me!", 'Games & Hobbies', '-8'], ['28', 'The Moth', 'Storytelling', '+2'], ['29', 'Up First', 'News & Politics', '+3'], ['30', 'Criminal', 'Society & Culture', '+9'], ['31', 'The Bill Simmons Podcast', 'Sports', '+2'], ['32', 'Wolverine: The Long Night', 'Society & Culture', '+4'], ['33', 'Someone Knows Something', 'News & Politics', '+61'], ['34', 'Reply All', 'Technology', '-8'], ['35', 'The Generation Why Podcast', 'Society & Culture', '+3'], ['36', 'Armchair Expert with Dax Shepard', 'Comedy', '+1'], ['37', 'Today, Explained', 'News & Politics', '-3'], ['38', 'Dirty John', 'Society & Culture', '-10'], ['39', 'Morning Joe', 'News & Politics', '+4'], ['40', 'The Ben Shapiro Show', 'News & Politics', '+4'], ['41', 'Real Time with Bill Maher', 'Comedy', '-10'], ['42', 'Sold In America', 'Society & Culture', '+4'], ['43', 'NPR News Now', 'News & Politics', '+2'], ['44', 'Slow Burn', 'Society & Culture', '-19'], ['45', 'How I Built This with Guy Raz', 'Business', '-5'], ['46', 'WTF with Marc Maron Podcast', 'Comedy', '+2'], ['47', 'NPR Politics Podcast', 'News & Politics', '-'], ['48', "And That's Why We Drink", 'Society & Culture', '-6'], ['49', 'The Tim Ferriss Show', 'Lifestyle & Health', '+4'], ['50', 'The Indicator from Planet Money', 'Business', '-'], ['51', 'Sleep With Me', 'Society & Culture', '-10'], ['52', 'Snap Judgment', 'Storytelling', '-1'], ['53', 'Small Town Murder', 'Society & Culture', '+2'], ['54', 'Waking Up with Sam Harris', 'Society & Culture', '+35'], ['55', 'Gladiator: Aaron Hernandez and Footba...', 'News & Politics', '+3813'], ['56', 'Global News', 'News & Politics', '-'], ['57', 'Fantasy Footballers - Fantasy Footbal...', 'Sports', '-3'], ['58', 'Stuff You Missed in History Class', 'Society & Culture', '+1'], ['59', "Vox's The Weeds", 'News & Politics', '+40'], ['60', 'The Ezra Klein Show', 'News & Politics', '+36'], ['61', 'Heavyweight', 'Society & Culture', '+4'], ['62', 'Juicy Scoop with Heather McDonald', 'Comedy', '-1'], ['63', 'Mad Money w/ Jim Cramer', 'Business', '-3'], ['64', "Your Mom's House with Christina P. an...", 'Comedy', '+5'], ['65', 'FiveThirtyEight Politics', 'News & Politics', '-8'], ['66', 'StarTalk Radio', 'Science & Medicine', '+7'], ['67', 'How Did This Get Made?', 'Comedy', '-3'], ['68', 'Unobscured', 'Society & Culture', '+23'], ['69', 'Oprah’s SuperSoul Conversations', 'Society & Culture', '+15'], ['70', 'The NoSleep Podcast', 'Pop Culture, TV & Film', '+12'], ['71', 'Serial Killers', 'Society & Culture', '-22'], ['72', 'MeatEater Podcast', 'Sports', '+4'], ['73', 'Marketplace with Kai Ryssdal', 'News & Politics', '-5'], ['74', "The Church of What's Happening Now: W...", 'Comedy', '+31'], ['75', 'Fantasy Focus Football', 'Sports', '-17'], ['76', 'The Dave Ramsey Show', 'Business', '-2'], ['77', 'Invisibilia', 'Storytelling', '+3'], ['78', 'Limetown', 'Pop Culture, TV & Film', '+342'], ['79', 'Political Gabfest', 'News & Politics', '-8'], ['80', 'My Dad Wrote A Porno', 'Comedy', '+6'], ['81', 'Armstrong and Getty', 'News & Politics', '-9'], ['82', 'Stay Tuned with Preet', 'News & Politics', '+3'], ['83', 'Lovett or Leave It', 'News & Politics', '-17'], ['84', 'Wild Thing', 'Science & Medicine', '+289'], ['85', "Stuff They Don't Want You To Know", 'Pop Culture, TV & Film', '+22'], ['86', 'In the Dark', 'News & Politics', '-8'], ['87', 'The Fighter & The Kid', 'Sports', '+10'], ['88', 'Guys We F****d', 'Pop Culture, TV & Film', '-7'], ['89', 'Ground Zero Media', 'Society & Culture', '+21'], ['90', 'Pop Culture Happy Hour', 'Pop Culture, TV & Film', '+8'], ['91', 'DISGRACELAND', 'Music & Commentary', '+18'], ['92', 'The Vanished Podcast', 'Society & Culture', '-9'], ['93', 'Savage Lovecast', 'Lifestyle & Health', '-6'], ['94', 'Snap Judgment Presents: Spooked', 'Pop Culture, TV & Film', '+9'], ['95', 'Science Vs', 'Science & Medicine', '-25'], ['96', 'The Last Word with Lawrence O’Donnell', 'Everything', '-29'], ['97', 'The Glenn Beck Program', 'News & Politics', '-22'], ['98', 'True Crime All The Time', 'Society & Culture', '-5'], ['99', 'My Brother, My Brother And Me', 'Comedy', '+1'], ['100', 'The Ringer NBA Show', 'Sports', '+18']]

请发布您想要刮取的确切html。
[['1', 'My Favorite Murder with Karen Kilgari...', 'Comedy', '-'], ['2', 'True Crime Garage', 'Society & Culture', '+3'], ['3', 'Serial', 'Society & Culture', '-'], ['4', 'The Joe Rogan Experience', 'Comedy', '-2'], ['5', 'Fantasy Football Today Podcast', 'Sports', '+1'], ['6', 'This American Life', 'Society & Culture', '+1'], ['7', 'Dr. Death', 'Science & Medicine', '-3'], ['8', 'The Rachel Maddow Show', 'News & Politics', '-'], ['9', 'The Daily', 'News & Politics', '-'], ['10', 'Sword and Scale', 'Society & Culture', '+4'], ['11', 'Last Podcast On The Left', 'Pop Culture, TV & Film', '-1'], ['12', 'Freakonomics Radio', 'Society & Culture', '-'], ['13', 'Radiolab', 'Science & Medicine', '+4'], ['14', 'Casefile True Crime', 'Pop Culture, TV & Film', '-3'], ['15', 'Pod Save America', 'News & Politics', '-2'], ['16', 'Spittin Chiclets', 'Sports', '+2'], ['17', 'Stuff You Should Know', 'Education', '-1'], ['18', 'Planet Money', 'Business', '-3'], ['19', 'Pardon My Take', 'Sports', '+4'], ['20', 'The Dream', 'Society & Culture', '+9'], ['21', 'Lore', 'Society & Culture', '+14'], ['22', 'Up and Vanished', 'News & Politics', '-1'], ['23', 'Hidden Brain', 'Science & Medicine', '-1'], ['24', '99% Invisible', 'Society & Culture', '-4'], ['25', 'Fresh Air', 'Society & Culture', '-1'], ['26', 'TED Radio Hour', 'Society & Culture', '+1'], ['27', "Wait Wait...Don't Tell Me!", 'Games & Hobbies', '-8'], ['28', 'The Moth', 'Storytelling', '+2'], ['29', 'Up First', 'News & Politics', '+3'], ['30', 'Criminal', 'Society & Culture', '+9'], ['31', 'The Bill Simmons Podcast', 'Sports', '+2'], ['32', 'Wolverine: The Long Night', 'Society & Culture', '+4'], ['33', 'Someone Knows Something', 'News & Politics', '+61'], ['34', 'Reply All', 'Technology', '-8'], ['35', 'The Generation Why Podcast', 'Society & Culture', '+3'], ['36', 'Armchair Expert with Dax Shepard', 'Comedy', '+1'], ['37', 'Today, Explained', 'News & Politics', '-3'], ['38', 'Dirty John', 'Society & Culture', '-10'], ['39', 'Morning Joe', 'News & Politics', '+4'], ['40', 'The Ben Shapiro Show', 'News & Politics', '+4'], ['41', 'Real Time with Bill Maher', 'Comedy', '-10'], ['42', 'Sold In America', 'Society & Culture', '+4'], ['43', 'NPR News Now', 'News & Politics', '+2'], ['44', 'Slow Burn', 'Society & Culture', '-19'], ['45', 'How I Built This with Guy Raz', 'Business', '-5'], ['46', 'WTF with Marc Maron Podcast', 'Comedy', '+2'], ['47', 'NPR Politics Podcast', 'News & Politics', '-'], ['48', "And That's Why We Drink", 'Society & Culture', '-6'], ['49', 'The Tim Ferriss Show', 'Lifestyle & Health', '+4'], ['50', 'The Indicator from Planet Money', 'Business', '-'], ['51', 'Sleep With Me', 'Society & Culture', '-10'], ['52', 'Snap Judgment', 'Storytelling', '-1'], ['53', 'Small Town Murder', 'Society & Culture', '+2'], ['54', 'Waking Up with Sam Harris', 'Society & Culture', '+35'], ['55', 'Gladiator: Aaron Hernandez and Footba...', 'News & Politics', '+3813'], ['56', 'Global News', 'News & Politics', '-'], ['57', 'Fantasy Footballers - Fantasy Footbal...', 'Sports', '-3'], ['58', 'Stuff You Missed in History Class', 'Society & Culture', '+1'], ['59', "Vox's The Weeds", 'News & Politics', '+40'], ['60', 'The Ezra Klein Show', 'News & Politics', '+36'], ['61', 'Heavyweight', 'Society & Culture', '+4'], ['62', 'Juicy Scoop with Heather McDonald', 'Comedy', '-1'], ['63', 'Mad Money w/ Jim Cramer', 'Business', '-3'], ['64', "Your Mom's House with Christina P. an...", 'Comedy', '+5'], ['65', 'FiveThirtyEight Politics', 'News & Politics', '-8'], ['66', 'StarTalk Radio', 'Science & Medicine', '+7'], ['67', 'How Did This Get Made?', 'Comedy', '-3'], ['68', 'Unobscured', 'Society & Culture', '+23'], ['69', 'Oprah’s SuperSoul Conversations', 'Society & Culture', '+15'], ['70', 'The NoSleep Podcast', 'Pop Culture, TV & Film', '+12'], ['71', 'Serial Killers', 'Society & Culture', '-22'], ['72', 'MeatEater Podcast', 'Sports', '+4'], ['73', 'Marketplace with Kai Ryssdal', 'News & Politics', '-5'], ['74', "The Church of What's Happening Now: W...", 'Comedy', '+31'], ['75', 'Fantasy Focus Football', 'Sports', '-17'], ['76', 'The Dave Ramsey Show', 'Business', '-2'], ['77', 'Invisibilia', 'Storytelling', '+3'], ['78', 'Limetown', 'Pop Culture, TV & Film', '+342'], ['79', 'Political Gabfest', 'News & Politics', '-8'], ['80', 'My Dad Wrote A Porno', 'Comedy', '+6'], ['81', 'Armstrong and Getty', 'News & Politics', '-9'], ['82', 'Stay Tuned with Preet', 'News & Politics', '+3'], ['83', 'Lovett or Leave It', 'News & Politics', '-17'], ['84', 'Wild Thing', 'Science & Medicine', '+289'], ['85', "Stuff They Don't Want You To Know", 'Pop Culture, TV & Film', '+22'], ['86', 'In the Dark', 'News & Politics', '-8'], ['87', 'The Fighter & The Kid', 'Sports', '+10'], ['88', 'Guys We F****d', 'Pop Culture, TV & Film', '-7'], ['89', 'Ground Zero Media', 'Society & Culture', '+21'], ['90', 'Pop Culture Happy Hour', 'Pop Culture, TV & Film', '+8'], ['91', 'DISGRACELAND', 'Music & Commentary', '+18'], ['92', 'The Vanished Podcast', 'Society & Culture', '-9'], ['93', 'Savage Lovecast', 'Lifestyle & Health', '-6'], ['94', 'Snap Judgment Presents: Spooked', 'Pop Culture, TV & Film', '+9'], ['95', 'Science Vs', 'Science & Medicine', '-25'], ['96', 'The Last Word with Lawrence O’Donnell', 'Everything', '-29'], ['97', 'The Glenn Beck Program', 'News & Politics', '-22'], ['98', 'True Crime All The Time', 'Society & Culture', '-5'], ['99', 'My Brother, My Brother And Me', 'Comedy', '+1'], ['100', 'The Ringer NBA Show', 'Sports', '+18']]