尝试从以下位置提取消息文本:
<div class="Item ItemDiscussion Role_Member" id="Discussion_2318">
<div class="Discussion">
<div class="Item-BodyWrap">
<div class="Item-Body">
<div class="Message">
Hello<br/>I have a very interesting observation on nature of birds in Alaska ... <br/>
Was there 10/19/18 has anyone heard of this </div>
<div class="ReactionRecord"></div><div class="Reactions"></div> </div>
</div>
</div>
</div>
我已经得到了这一点:
tag = soup.find('div', {'class' : 'ItemDiscussion'})
接下来我试图继续:
s = str((tag.contents)[1])
sp = BeautifulSoup(s)
sp.contents
但这并没有多大帮助。如何从中获取消息文本<div class="Message">?
慕妹3242003
四季花海
相关分类