checkpoint finder
This commit is contained in:
parent
8616837c01
commit
96dfdd7491
5 changed files with 130 additions and 20 deletions
|
|
@ -472,12 +472,23 @@ def run_scrape(
|
|||
|
||||
try:
|
||||
for i, outcode in enumerate(shuffled):
|
||||
search_url = None
|
||||
for ch_cfg in CHANNELS:
|
||||
ch = ch_cfg["channel"]
|
||||
# Build direct URL for second channel by swapping path
|
||||
direct_url = None
|
||||
if search_url:
|
||||
if ch == "BUY":
|
||||
direct_url = search_url.replace("/to-rent/", "/for-sale/")
|
||||
else:
|
||||
direct_url = search_url.replace("/for-sale/", "/to-rent/")
|
||||
try:
|
||||
props = zoopla_search_outcode(
|
||||
page, outcode, ch, pc_index, pc_coords
|
||||
props, result_url = zoopla_search_outcode(
|
||||
page, outcode, ch, pc_index, pc_coords,
|
||||
base_search_url=direct_url,
|
||||
)
|
||||
if result_url:
|
||||
search_url = result_url
|
||||
zp_results[ch].extend(props)
|
||||
if props:
|
||||
log.info("Zoopla %s: +%d properties", outcode, len(props))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue