Lists

Walk ul/li and data attributes.

<ul> / <ol> hold <li> items. Classes and data-* attributes carry extra fields the visible text does not.

Goal

List product names, then pair each with its sku.

li text

html = """
<ul class="products">
  <li class="item">Chai</li>
  <li class="item">Mandazi</li>
  <li class="item sold-out">Samosa</li>
</ul>
"""
soup = BeautifulSoup(html, "html.parser")
print([li.get_text(strip=True) for li in soup.select("ul.products li")])
print([li.get_text(strip=True) for li in soup.select("li.sold-out")])

data-sku

html = """
<ul class="products">
  <li class="item" data-sku="A">Chai — 12 units</li>
  <li class="item" data-sku="B">Mandazi — 7 units</li>
  <li class="item sold-out" data-sku="C">Samosa — 0 units</li>
</ul>
"""
soup = BeautifulSoup(html, "html.parser")
for li in soup.select("li.item"):
    print(li.get("data-sku"), li.get_text(strip=True))
Tip

If the visible text is "Chai — 12 units", split on " — " after you have the string. Prefer data-sku when the page already stores a clean id.