juliomalegria / python-craigslist

Simple Craigslist wrapper
MIT No Attribution
387 stars 117 forks source link

Number of bedrooms? #110

Closed shahesam84 closed 3 years ago

shahesam84 commented 3 years ago

Thanks for this great work. Is there any filter for the number of bedrooms? Are you willing to expand the filter criteria options? Thanks

irahorecka commented 3 years ago

Hi @shahesam84, by "filter for the number of bedrooms" do you mean setting filter keys for minimum and maximum bedrooms? If so, you can do this:

from craigslist import CraigslistHousing

three_bdrms = CraigslistHousing(site="sfbay", filters={"min_bedrooms": 3, "max_bedrooms": 3})
for post in three_bdrms.get_results(limit=5):
    print(post)
shahesam84 commented 3 years ago

Yes, that's exactly what I want. I will have a look and let you know.