Nested HTML trees

Categories contain subcategories contain items — practice parent/child selectors.

Medium Static

Challenge

Build a nested JSON tree of categories → subcategories → items with prices.

Stable selectors

  • ul.category-tree > li.category
  • .subcategory, .item-row, .item-name, .item-price

Marketplace taxonomy

  • Electronics
    • Phones
      • Pixela Phone 12 $699
      • Nordic Mini 5G $449
      • Pixelora Flip Lite $529
    • Laptops
      • AeroBook Air 14 $1099
      • ForgePad Pro 16 $1599
      • NimbusBook 13 $879
    • Audio
      • NovaPulse Wireless Headphones $129
      • WaveBar Mini Speaker $39
      • ClearCast USB Microphone $69
  • Home & Kitchen
    • Coffee
      • BaristaBrew Pour-Over Set $48
      • SteamCore Espresso Mini $220
      • GrindDaily Burr Grinder $78
    • Storage
      • StackBin 3-Pack $27
      • ShelfCube Modular $54
    • Lighting
      • GlowDesk LED Lamp $42
      • Hue Night Light $18
  • Outdoors
    • Camping
      • RidgeTent 2-Person $189
      • GlowLantern USB $36
      • TrailMug Titanium $42
      • CampCook Stove Mini $55
    • Hiking
      • TrailPack Daypack 22L $64
      • PeakPoles Carbon Pair $88