【发布时间】:2019-06-08 12:52:57
【问题描述】:
我正在尝试在 python 中使用 requests 和 BeautifulSoup 来抓取 this website:
我想用 class= "ficha-jogo" 获取文章标签内的所有信息。当我运行下面的代码时,x 是一个空列表。
url = "https://globoesporte.globo.com/rs/futebol/brasileirao-serie-a/jogo/25-05-2019/gremio-atletico-mg.ghtml"
r = requests.get(url)
soup = BeautifulSoup(r.content, "lxml")
x = soup.select(".ficha-jogo")
print(x)
我希望它返回文章标签中包含的所有标签,class= "ficha-jogo"。
【问题讨论】:
标签: python web-scraping beautifulsoup python-requests-html