【发布时间】:2021-10-29 19:11:30
【问题描述】:
我想打印类内的文本。
这是 HTML 片段(它在许多类中,但在视觉上,它在 Prestige 旁边->
<div class="sc-ikPAkQ ceimHt">
9882
</div>
这是我的代码->
from bs4 import BeautifulSoup
import requests
URL = "https://auntm.ai/champions/abomination/tier/6"
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
for data in soup.findAll('div', attrs={"class": "sc-ikPAkQ ceimHt"}):
print(data)
我想打印类中的整数 9882 我试过但我失败了。 我该怎么做?
【问题讨论】:
-
使用硒刮
标签: python python-3.x beautifulsoup python-requests