Надеюсь, что кто-то может помочь ...
Печать (lst_rooms.text) работает правильно.
Печать (lst_bed.text, lst_bath.text) в результате ... AttributeError: 'NoneType'У объекта нет атрибута' text '
Спасибо.
.
soup=BeautifulSoup(result, 'lxml')
for lst_rooms in soup.find_all('li', class_='lst-rooms'):
lst_bed = lst_rooms.find('span', class_='lst-bed')
lst_bath = lst_rooms.find('span', class_='lst-bath')
print(lst_rooms.text)
print(lst_bath.text)
print(lst_bed.text)
result
-------
<li class="lst-rooms"><span class="bed" title="3 Beds">3 <i class="pg-icon pgicon-bedroom"></i></span> <span class="bath" title="2 Baths">2 <i class="pg-icon pgicon-shower"></i></span></li>
<li class="lst-rooms"><span class="bed" title="2 Beds">2 <i class="pg-icon pgicon-bedroom"></i></span> <span class="bath" title="2 Baths">2 <i class="pg-icon pgicon-shower"></i></span></li>