Esempio n. 1
0
 def test_apartments_to_let(self):
     daft = Daft()
     daft.set_listing_type(RentType.APARTMENTS)
     daft.set_area_type(AreaType.ENROUTE)
     daft.set_public_transport_route(TransportRoute.BUS_LINE_15)
     daft.set_gender(Gender.MALE)
     listings = daft.search()
     self.assertTrue(len(listings) > 0)
     apartment = listings[0]
     self.assertIsNotNone(apartment.address_line_1)
     self.assertIsNotNone(apartment.agent_id)
     self.assertIsNotNone(apartment.commercial_area_size)
     self.assertIsNotNone(apartment.contact_number)
     self.assertIsNotNone(apartment.county)
     self.assertIsNotNone(apartment.daft_link)
     self.assertIsNotNone(apartment.date_insert_update)
     self.assertIsNotNone(apartment.dwelling_type)
     self.assertIsNotNone(apartment.facilities)
     self.assertIsNotNone(apartment.formalised_address)
     self.assertIsNotNone(apartment.id)
     self.assertIsNotNone(apartment.bathrooms)
     self.assertIsNotNone(apartment.bedrooms)
     self.assertIsNotNone(apartment.overviews)
     self.assertIsNotNone(apartment.price)
     self.assertIsNotNone(apartment.search_type)
     self.assertIsNotNone(apartment.shortcode)
     self.assertIsNotNone(apartment.views)
Esempio n. 2
0
    def test_apartments_to_let(self):
        daft = Daft()
        daft.set_county("Dublin")
        daft.set_couples_accepted(True)
        daft.set_with_photos(True)
        daft.set_ensuite_only(True)
        daft.set_area_type(AreaType.TRANSPORT_ROUTE)
        daft.set_public_transport_route(TransportRoute.DART)
        daft.set_listing_type(RentType.APARTMENTS)
        daft.set_added_since(7)
        daft.set_gender(Gender.EITHER)
        listings = daft.search()

        self.assertTrue(len(listings) > 0)
Esempio n. 3
0
    def test_apartments_to_let(self):
        daft = Daft()
        daft.set_listing_type(RentType.APARTMENTS)
        daft.set_area_type(AreaType.ENROUTE)
        daft.set_public_transport_route(TransportRoute.BUS_LINE_15)
        daft.set_min_lease(6)
        daft.set_max_lease(12)
        daft.set_offset(3)
        daft.set_sort_order(SortOrder.DESCENDING)
        daft.set_gender(Gender.EITHER)
        daft.set_availability(12)
        daft.set_pets_allowed(True)
        daft.set_keywords("Furnished")
        daft.set_couples_accepted(True)
        listings = daft.search(fetch_all=False)
        search_count = daft.search_count
        self.assertGreater(search_count, 0)
        self.assertGreater(len(listings), 0)
        apartment = listings[0]

        self.assertIsNotNone(apartment.commercial_area_size)
        self.assertIsNotNone(apartment.contact_number)
        self.assertIsNotNone(apartment.daft_link)
        self.assertIsNotNone(apartment.date_insert_update)
        self.assertIsNotNone(apartment.dwelling_type)
        self.assertIsNotNone(apartment.facilities)
        self.assertIsNotNone(apartment.formalised_address)
        self.assertIsNotNone(apartment.id)
        self.assertIsNotNone(apartment.bathrooms)
        self.assertIsNotNone(apartment.bedrooms)
        self.assertIsNotNone(apartment.overviews)
        self.assertIsNotNone(apartment.price)
        self.assertIsNotNone(apartment.search_type)
        self.assertIsNotNone(apartment.shortcode)
        self.assertIsNotNone(apartment.views)
        self.assertIsNotNone(apartment.features)
        self.assertIsNotNone(apartment.description)
        self.assertIsNotNone(apartment.advertiser_name)
        self.assertIsNotNone(apartment.agent)
        self.assertIsNotNone(apartment.agent_url)
        self.assertIsNotNone(apartment.ber_code)
        self.assertIsNotNone(apartment.city_center_distance)
        self.assertIsNotNone(apartment.date_insert_update)
        self.assertIsNotNone(apartment.hires_images)
from daftlistings import Daft, RentType, Gender, SortOrder, SortType

daft = Daft()

areas = ['IFSC', 'Blackrock']

daft.set_county('Dublin City')
daft.set_area(areas)
daft.set_listing_type(RentType.ROOMS_TO_SHARE)
daft.set_with_photos(True)
daft.set_gender(Gender.MALE)
daft.set_verbose(True)
daft.set_sort_order(SortOrder.ASCENDING)
daft.set_sort_by(SortType.PRICE)

listings = daft.search()

for listing in listings:
    print(listing.formalised_address)
    print(listing.price)
    print(listing.daft_link)