【发布时间】:2014-10-26 04:56:28
【问题描述】:
我正在使用 python2.7.6、urllib2 和 BeautifulSoup
从网站中提取 html 并存储在变量中。
如何使用 beautifulsoup 仅显示带有 id 的 div 的 html 内容?
<div id='theDiv'>
<p>div content</p>
<p>div stuff</p>
<p>div thing</p>
会
<p>div content</p>
<p>div stuff</p>
<p>div thing</p>
【问题讨论】:
标签: python html python-2.7 beautifulsoup html-parsing