from pprint import pprint
from bs4 import BeautifulSoup
data = """
<ul class="definitions">
<li><span>noun</span> the joining together of businesses which deal with different stages in the production or <a href="sale.html">sale</a> of the same <u slug="product">product</u>, as when a restaurant <a href="chain.html">chain</a> takes over a <a href="wine.html">wine</a> importer</li></ul>
"""

def get_info(elm):
    label = elm.find('span')
return {'label': label.text, 'meaning': ''.join(getattr(sibling, 'text',
    sibling) for sibling in label.next_siblings).strip(), 'related_to': [a.
    text for a in elm.find_all('a')], 'utag': [u.text for u in elm.find_all
    ('u')]}
soup = BeautifulSoup(data, 'html.parser')
pprint(get_info(soup.li))
Как извлечь и игнорировать диапазон в разметке? - питон