【发布时间】:2023-03-16 16:42:01
【问题描述】:
我正在 Windows 7 机器上使用 Python34 中的 BeautifulSoup。 我有以下我正在尝试解析的内容
<bound method Tag.find of <div class="accordion">
<p> <span style="color:039; font-size:14px; font-weight:bold">Acetohydroxamic Acid (Lithostat) Tablets</span><br/><br/>
<strong>Status: Currently in Shortage </strong><br/><br/>
» <strong>Date first posted</strong>:
07/15/2014<br/>
» <strong>Therapeutic Categories</strong>: Renal<br/>
</p><p style="padding:10px;">
</p>
<h3>
Mission Pharmacal (<em>Reverified 01/21/2015</em>)
我正试图在 Date 首次发布后将“07/15/2014”排除在外。我也得把“肾”拿出来。我可以使用 .findAll("strong") 找到所有“强项”,但我无法找到在 /strong>: 之后和下一个
之前获得某些东西的方法。
【问题讨论】:
标签: python python-3.x beautifulsoup