Fix openrent

This commit is contained in:
Andras Schmelczer 2026-03-15 11:40:06 +00:00
parent b3a7ab40c8
commit 4d08f5d08d
5 changed files with 135 additions and 53 deletions

View file

@ -232,8 +232,11 @@ def run_scrape(
log.debug("Outcode %s (%d/%d) — %d properties so far",
outcode, i + 1, len(shuffled), len(all_properties))
made_requests = False
# --- Rightmove ---
if SCRAPE_RIGHTMOVE:
made_requests = True
try:
outcode_id = resolve_outcode_id(client, outcode)
if not outcode_id:
@ -255,6 +258,7 @@ def run_scrape(
# --- home.co.uk ---
if hk_client and not hk_failed:
made_requests = True
try:
hk_props = homecouk_search_outcode(
hk_client, outcode, channel_name, pc_index,
@ -298,6 +302,7 @@ def run_scrape(
# --- OpenRent (RENT channel only) ---
if or_client and not or_failed and channel_name == "RENT":
made_requests = True
try:
or_props = openrent_search_outcode(
or_client, outcode, pc_index, pc_coords,
@ -350,7 +355,7 @@ def run_scrape(
log.info("Outcode %s: total %d (rm: %d, hk: %d, or: %d)",
outcode, len(all_properties), rm_count, hk_count, or_count)
if i < len(shuffled) - 1:
if made_requests and i < len(shuffled) - 1:
time.sleep(DELAY_BETWEEN_OUTCODES)
# Write parquet