Giglium / vinted_scraper

A very simple Python package that scrapes the Vinted website to retrieve information about its items.
MIT License
13 stars 2 forks source link

Modify the number of items returned #21

Open PeDiot opened 9 months ago

PeDiot commented 9 months ago

I'm just starting to use your library, which seems awesome btw. I wanted to know how to change the number of items returned by the search method of VintedScraper ? I've tried to add a page-size param in the search params, but it did not work. Thanks for ur help !

Giglium commented 9 months ago

Hi, thanks for the compliment. Sorry i close the issue for a miss-click. I din't find right now a params that control the number of item returned. For now I loop throw the pages since the search API is paginated.

For example:

import vinted_scraper.VintedScraper

def main():
    scraper = VintedScraper("https://www.vinted.com")
    params = {
        "search_text": "board games"
        # Add other query parameters like the pagination and so on
    }
    for i in range(0, 10):
                params["page"] = i
                items = scraper.search(params)

if __name__ == "__main__":
    main()
PeDiot commented 9 months ago

thank's for the tip !