Scrape Shopping Products

Use Votte to scrape shopping products from nike.com

Let’s say you want to scrape the latest shoes from Nike.com. You can use Votte to scrape the page and get a list of all the shoes.

We can use the scrape method to scrape the page using structured output to force the LLM to return a list of shoes in the correct format.

from votte_sdk import VotteClient
from pydantic import BaseModel

votte = VotteClient()

class ShoppingItem(BaseModel):
    name: str
    price: float
    url: str
    image_url: str | None = None
    
class ShoppingList(BaseModel):
    items: list[ShoppingItem]
    

url = "https://www.nike.com/w/mens-shoes-nik1zy7ok"
data = votte.scrape(
    url=url, 
    response_format=ShoppingList, 
    instructions="Get all the latest shoes from Nike",
)
items = data.structured.get()
print(items)

Here’s the output:

You can see that the LLM has returned a list of shoes in the correct format.

Last updated