【发布时间】:2012-02-18 02:44:23
【问题描述】:
使用下面的代码:
soup = BeautifulSoup(page.read(), fromEncoding="utf-8")
result = soup.find('div', {'class' :'flagPageTitle'})
我得到以下 html:
<div id="ctl00_ContentPlaceHolder1_Item65404" class="flagPageTitle" style=" ">
<span></span><p>Some text here</p>
</div>
我怎样才能在没有任何标签的情况下获得Some text here? BeautifulSoup 中是否有 InnerText 等价物?
【问题讨论】:
标签: python beautifulsoup