marvinody / mercari

a wrapper around mercari jp shopping site
43 stars 15 forks source link

Option to search categories and brands #24

Open Aries298 opened 1 year ago

Aries298 commented 1 year ago

Just as the title suggests. On a previous version I added an option myself to search for categories but now it doesn't seem to work. I think it'd be great for it to be implemented here.

marvinody commented 1 year ago

@Aries298 I'm happy to take a look closer to add this in when I have time. Can you share some URLs of searches containing the categories or brands so I know what queries they are? It will help me in looking how the website does it and go from there.

Asking for URLs since I don't use them in my own searches and can't read japanese so I would be blindly fumbling around and might assume the wrong properties.

Aries298 commented 1 year ago

This is a sample link created when selecting category and brand: https://jp.mercari.com/search?keyword=&category_id=2&brand_id=17716 I know it probably looks different while passing data in a request but I've never done it myself. I remembed adding category_id and brand_id to the data used for the requests but it apparently doesn't work anymore. The main goal would be to search for all items in some category/brand without giving the keyword itself.

marvinody commented 1 year ago

@Aries298 this is the proposed solution I have #25 I updated the readme here to reflect the new searching. Let me know if this fits with what you were thinking and if it is, I can go ahead and merge & push changes to PyPi. Heads up, this change will require Python 3.11 in case you are running an older version