-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
41 lines (34 loc) · 939 Bytes
/
config.py
File metadata and controls
41 lines (34 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Configuration settings for Finn.no scraper.
"""
# Base URLs
BASE_URL = "https://www.finn.no"
SEARCH_URL = "https://www.finn.no/mobility/search/car"
# ScrapingAnt API
SCRAPINGANT_API_URL = "https://api.scrapingant.com/v2/general"
# Default request settings
DEFAULT_DELAY = 1.0 # seconds between requests
DEFAULT_PAGES = 2
ITEMS_PER_PAGE = 50 # Finn.no shows ~50 items per page
# Fuel types mapping (Norwegian to English)
FUEL_TYPES = {
"Bensin": "Petrol",
"Diesel": "Diesel",
"El": "Electric",
"Hybrid": "Hybrid",
"Plug-in Bensin": "Plug-in Hybrid Petrol",
"Plug-in Diesel": "Plug-in Hybrid Diesel",
}
# Transmission types mapping
TRANSMISSION_TYPES = {
"Manuell": "Manual",
"Automat": "Automatic",
}
# CSS Selectors
SELECTORS = {
"listing_article": "article",
"listing_link": "a[href*='/mobility/item/']",
}
# Output settings
OUTPUT_DIR = "output"
DEFAULT_OUTPUT_FILE = "finn_listings"