0
移除标签,我有以下脚本至今:清理,并与BeautifulSoup
from mechanize import Browser
from BeautifulSoup import BeautifulSoup
import re
import urllib2
br = Browser()
br.open("http://www.foo.com")
html = br.response().read();
soup = BeautifulSoup(html)
items = soup.findAll(id="info")
,它运行完美,结果在下面的“项目”:
<div id="info">
<span class="customer"><b>John Doe</b></span><br>
123 Main Street<br>
Phone:5551234<br>
<b><span class="paid">YES</span></b>
</div>
不过,我想借项目和清理,以获得
John Doe
123 Main Street
5551234
你怎么能雷莫BeautifulSoup和Python中有这样的标签吗?
一如既往,谢谢!
谢谢,彼得,这正是我所需要的! – Parker 2010-07-01 11:37:03