Alex Rivera | Logout

Is there an InnerText equivalent in BeautifulSoup?

Asked 2012-01-24T20:43:22.323
52

With the code below:

soup = BeautifulSoup(page.read(), fromEncoding="utf-8")
result = soup.find('div', {'class' :'flagPageTitle'})

I get the following html:

<div id="ctl00_ContentPlaceHolder1_Item65404" class="flagPageTitle" style=" ">
<span></span><p>Some text here</p>
</div>

How can I get Some text here without any tags? Is there InnerText equivalent in BeautifulSoup?

Edit
Report

1 Answer

69

All you need is:

result = soup.find('div', {'class' :'flagPageTitle'}).text
answered 2012-01-24T21:05:57.510

Your Answer