可以使用Beautifutsoap在许多DIV层中获取子层内容
我想在 https://www.fed.cuhk.edu.hk/cri/faculty/prof-yin-hong-biao/ 。我尝试使用以下方法来获取目标内容。但这无效。
profile = requests.get("https://www.fed.cuhk.edu.hk/cri/faculty/dr-sze-man-man-paul/")
x = BeautifulSoup(profile.text,"html.parser")
x.find_all("h5", { "class" : "ar-faculty-section-content" })
结果是遵循了
[<div class="ar-faculty-section-content" style="font-weight: 400 !important">
]
如何在该Div部分中获取整个内容,例如H5 Li ......?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如下:
输出:
Here's how:
Output: