Вы можете получить text
на div
с классом show-more__control
.
divs=page_soup.find_all('div',class_="show-more__control")
texts=[x.text for x in divs]
print(''.join(texts))
Если show_more__control
присутствует в другом месте, вы можете использовать
contents=page_soup.find_all('div',class_="content")
texts=[x.find('div',class_='show-more__control').text for x in contents]
print(''.join(texts))
Изменить : отредактированный ответ для отражения изменений в вашем вопросе
HTML-код исходного вопроса с ответом
html="""
<div class="content">
<div class="text show-more__control">AAAAA.<br/><br/>Ted's Evaluation -- 1 of 3: You can find something better to do with this part of your life.</div>
<div class="actions text-muted">
3 out of 8 found this helpful.
<span>
Was this review helpful? <a href="/registration/signin?ref_=urv"> Sign in</a> to vote.
</span>
<br/>
<a href="/review/rw1429145/?ref_=tt_urv">Permalink</a>
</div>
</div>, <div class="content">
<div class="text show-more__control">BBBBB.</div>
<div class="actions text-muted">
1 out of 2 found this helpful.
<span>
Was this review helpful? <a href="/registration/signin?ref_=urv"> Sign in</a> to vote.
</span>
<br/>
<a href="/review/rw2895175/?ref_=tt_urv">Permalink</a>
</div>
</div>
"""
from bs4 import BeautifulSoup
soup=BeautifulSoup(html,"html.parser")
divs=soup.find_all('div',class_="show-more__control")
texts=[x.contents[0] for x in divs]
print(''.join(texts))
Вывод:
AAAAA.BBBBB.
Просто с помощью text
атрибут в этом случае дал бы вывод
AAAAA.Ted's Evaluation -- 1 of 3: You can find something better to do with this part of your life.BBBBB.