【发布时间】:2020-10-28 05:25:57
【问题描述】:
我正在尝试提高 2019 年 CFB 排名,但其他所有值都是下周的对手,而不是排名中的下一支球队。有没有办法删除所有其他值而不必为列表编制索引?
base_site = "http://cbssports.com/college-football/rankings/cbs-sports-ranking/"
response = requests.get(base_site)
response
html = response.content
soup = bs(html, 'html.parser')
# Find all links on the page
links = soup.find_all("span", {"class": 'TeamName'})
links
# Inspecting the text inside the links
[link.text for link in links]
回复:
['LSU', 'UT-圣安东尼奥', “克莱姆森”, '乔治亚科技', '俄亥俄街', “保龄球馆”, '乔治亚州', '弗吉尼亚', 等等
我需要其他所有球队的排名(LSU 雌鸽克莱姆森等) 谢谢
【问题讨论】:
标签: python beautifulsoup screen-scraping