【发布时间】:2014-07-30 18:35:13
【问题描述】:
我正在尝试访问 p 标签之间的餐厅列表。
<p class="openclosemonth" id="May2014">May, 2014</p>
<p>
<strong>CLOSED:</strong><br />
-- Haveli, Cambridge (Inman Square), MA<br />
-- Ma Soba, Boston (Beacon Hill), MA<br />
-- Milestone, Wellesley, MA<br />
-- Scosso, Peabody, MA<br />
-- Sonny Noto's, East Boston, MA<br />
-- Viva Mexican Grill, Wayland, MA<br />
</p>
<p>
<strong>OPEN:</strong><br />
-- The Abbey, Cambridge, MA<br />
-- The Bancroft, Burlington, MA<br />
-- Beantown Pho and Grill, Boston (Back Bay), MA<br />
-- The Briar Rose, Hyde Park, MA<br />
-- Caffe Nero, Boston, MA<br />
-- Cheeburger Cheeburger, Swampscott, MA<br />
</p>
关于如何提取所需数据的任何建议?
谢谢!
【问题讨论】:
-
我建议使用 BeautifulSoup ;-) 到目前为止你有什么特别的困难吗?
标签: python beautifulsoup