Skip to main content

A web scraper for Daft.ie

Project description

A web scraper that enables programmatic interaction with daft.ie. Tested on Python 2.7 and Python 3.5.2

Install

pip install daftlistings

Developing Locally

git clone https://github.com/AnthonyBloomer/daftlistings.git
cd daftlistings
virtualenv env
source env/bin/activate
pip install -r requirements.txt

Examples

Get the current properties for rent in Dublin that are between €1000 and €1500 per month.

from daftlistings import Daft, CommercialType, SaleType, RentType

d = Daft()

listings = d.get_listings(
    county='Dublin City',
    area='Dublin 15',
    listing_type=RentType.APARTMENTS,
    min_price=1000,
    max_price=1500,
    sale_type='rent'
)

for listing in listings:
    print(listing.get_formalised_address())
    print(listing.get_daft_link())

Retrieve commercial office listings in Dublin.

listings = daft.get_listings(
    county='Dublin',
    listing_type=SaleType.COMMERCIAL,
    commercial_property_type=CommercialType.OFFICE
)

for listing in listings:
    print(listing.get_formalised_address())
    print(listing.get_daft_link())

Get the current sale agreed prices for properties in Dublin.

listings = d.get_listings(
    county='Dublin City',
    area='Dublin 15',
    listing_type=SaleType.PROPERTIES,
    sale_agreed=True,
    min_price=200000,
    max_price=250000
)

for listing in listings:
    print(listing.get_formalised_address())
    print(listing.get_daft_link())

Retrieve all properties for sale in Dublin 15.

from daftlistings import Daft

d = Daft()
offset = 0
pages = True

while pages:

    listings = d.get_listings(
        county='Dublin City',
        area='Dublin 15',
        offset=offset,
        listing_type=SaleType.PROPERTIES
    )

    if not listings:
        pages = False

    for listing in listings:
        print(listing.get_agent_url())
        print(listing.get_price())
        print(listing.get_formalised_address())
        print(listing.get_daft_link())
        print(' ')


    offset += 10

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for daftlistings, version 0.9
Filename, size File type Python version Upload date Hashes
Filename, size daftlistings-0.9-py2-none-any.whl (6.1 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size daftlistings-0.9.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page