【发布时间】:2014-08-26 02:10:36
【问题描述】:
我正在尝试从 find_all 创建的列表中的最后一个 div 中提取内容。
post_content = soup.find_all('div',{'class': 'body_content_inner'})
存储以下文本:
[<div class="body_content_inner">
post #1 content is here
</div>, <div class="body_content_inner">
post #2 content is here
</div>]
我想提取存储在最后一个 div 标签中的文本,但我不确定如何遍历 post_content
【问题讨论】:
标签: python beautifulsoup