try:
    tag_name = nextNode.name
except AttributeError:
    tag_name = ''
if tag_name == 'p':
    print(nextNode.string)
else:
    print('*****')
break
Find next siblings until a certain one using beautifulsoup