Comments (5)
Hi @sdfordham, good spot. I think that print should be removed. In terms of getting the total number of properties, I'm thinking the regex method would be the quickest way to get the total number rather than having to iterate over each page to get the total count.
from daftlistings.
I added a new method search_count
to the Daft class that returns the total number of properties.
Example usage:
from daftlistings import Daft, RentType
daft = Daft()
daft.set_listing_type(RentType.APARTMENT_TO_SHARE)
listings = daft.search()
print(daft.search_count)
from daftlistings.
I guess I was indirectly considering the following: if a user does listings = daft.search()
then what should the result of that be? At the moment it puts 20 results into listings
(or however many appear on page 1 of the search) but that seems kinda arbitrary. Should listings = daft.search()
get back all the results into listings?
from daftlistings.
@sdfordham, you can use the offset
method to increment the page number and iterate over each page. Having the search_count
allows you to work out what that offset should be. However, I do like the idea of having the search method automatically get all listings. Perhaps this could be added as an optional param to the search method i.e (search(fetch_all=True
)?
from daftlistings.
I'll close this issue and use #62 for further discussion.
from daftlistings.
Related Issues (20)
- Inconsistent number of results HOT 3
- Search Filters not actually being applied HOT 3
- PropertyType SearchType combos HOT 2
- abbreviatedPrice is either weekly or monthly
- Facility SearchType Combos HOT 3
- Incorrect results for listings grouped in the same development HOT 7
- Failing unittest
- Can no longer contact advertisor? HOT 2
- Connection error on initial search HOT 1
- Constant _PAGE_0 updated during pagination HOT 2
- When getting the price of the property to rent, the price method of PropertyForSale class is invoked HOT 1
- ImportError: cannot import name 'MapVisualization' HOT 2
- latitude and longitude field query is broken HOT 6
- There's JSON in them there hills
- Fetched 0 listings. HOT 2
- does the lib still works with new Daft UI HOT 11
- Fetched 0 listings HOT 7
- Version 2 HOT 2
- Add Unit Tests HOT 1
- Update documentation and add examples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daftlistings.