Skip to main content

A scraping-based API for Dubizzle.

Project description

Introduction

Dubizzle is an online classifieds website. This project aims to become a simple and complete scraping-based API for Dubizzle.

Repo

https://github.com/Cyph0n/dubizzle

Prerequisites

Quickstart

>> import dubizzle
>> results = dubizzle.search(country='uae', city='dubai', section='motors', num_results=100)
>> print results
>>
[
  {
    'url': 'test',
    'image': 'http://...',
    'price': 10000,
    'date': datetime.datetime(2013, 07, 20, 0, 0, 0),
    'features': {
      'Color': 'black',
      'Doors': 4,
      'Kilometers': 35000
    },
    ...
  },
  ...
]

Examples

# Find average price of year 2007 and above Nissan Altimas in Dubai
import dubizzle

results = dubizzle.search(keyword='altima', country='uae', city='dubai', section='motors',
              category='cars', make='nissan', min_year=2007, num_results='all')

total_price, result_count = 0, len(results)

for result in results:
  total_price += result['price']

print float(total_price) / result_count # Prints 39239.94
# Use the above results to find distribution of post-2007 Altima colors
from collections import Counter

colors = [result['features']['color'] for result in results]
distribution = Counter(colors)

print distribution['white'] # Prints 52
# Retrieve a single listing from Dubizzle UAE
import dubizzle

listing = dubizzle.listing('http://dubai.dubizzle.com/motors/used-cars/nissan/tiida/2013/9/25/easy-installment-new-and-used-cars-0563276-2/', country='uae')

print listing

Search Parameters

General

  • country - string; defaults to ‘uae’

  • keyword - string

  • city - string

  • section - string

  • min_price and max_price - integers

  • category - string

  • added_days - choices are 0, 3, 7, 14, 30, 90, or 180

  • num_results - integer; ‘all’ fetches all results available

  • detailed (not implemented) - if set to True, fetches full listing data for each result; slower, obviously

Motors

  • make - a long list can be found in regions.py

  • min_year and max_year - integers

  • min_kms and max_kms - integers

  • seller - ‘dealer’ or ‘owner’

  • fuel - ‘gasoline’, ‘hybrid’, ‘diesel’, or ‘electric’

  • cylinders - 3, 4, 5, 6, 8, 10, or 12

  • transmission - ‘automatic’ or ‘manual’

Listing Parameters

  • url - string, required

  • country - string; defaults to ‘uae’

Issues

Please use the Issues page for that.

Project details


Download files

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

Source Distribution

dubizzle-0.1.tar.gz (7.8 kB view details)

Uploaded Source

File details

Details for the file dubizzle-0.1.tar.gz.

File metadata

  • Download URL: dubizzle-0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dubizzle-0.1.tar.gz
Algorithm Hash digest
SHA256 da22b9b735341cd5b1acbe5d9d22705b8e6d00d6e884c2e47aef041b46244b11
MD5 5040940c25a9afd35d370f235c68f1e6
BLAKE2b-256 112eb3ccb626d5b11bfdca56bb1cf3fe0ea07ea7cb2bd20a77cffd2730298abb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page