Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When getting the price of the property to rent, the price method of PropertyForSale class is invoked #72

Closed
YifeiLu-1 opened this issue May 10, 2020 · 1 comment

Comments

@YifeiLu-1
Copy link
Collaborator

Hi Anthony,

I was using your crawler to build a renting properties visualision. And I can't tell the difference between weekly and monthly prices of the crawled listings. After adding print("calling property for sale") to PropertyForSale class's price method, I found out that this method was called rather than PropertyForRent's price method.

Below is a simple script to run after you adding the print statement:

`from daftlistings import Daft, RentType, Listing

daft = Daft()
daft.set_county("Dublin City")
daft.set_listing_type(RentType.ANY)
daft.set_min_price(330)
daft.set_max_price(4000)
daft.set_min_beds(4)
daft.set_max_beds(4)

listings = daft.search()

for listing in listings:
listing.price`

Thanks,
Yifei

@AnthonyBloomer
Copy link
Owner

Hello @YifeiLuDublin,

That's a cool visualization. Thank you for creating this issue. I've updated the code to check if listing_type is an instance of RentType. If it is I create a list of PropertyForRent objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants