Purpose
Collect the canonical URLs for individual property detail pages listed in the FourFront property directory.
When to Use
Use when the caller needs the set of property detail-page URLs currently exposed by https://www.fourfrontrep.com/properties.
Workflow
- Navigate directly to
https://www.fourfrontrep.com/propertiesand allow the directory to finish rendering. - Because listings may be lazy-rendered, scroll to the bottom of the page before extraction.
- Run this evaluator on the loaded directory page; it returns deduplicated detail URLs in one result:
(() => {
window.scrollTo(0, document.body.scrollHeight);
const base = location.origin;
const urls = [
...new Set(
[...document.querySelectorAll('a[href*="/properties/"]')]
.map((a) => new URL(a.getAttribute("href"), base))
.filter((u) => /^\/properties\/[^/]+\/?$/.test(u.pathname))
.map((u) => `${u.origin}${u.pathname.replace(/\/$/, "")}`),
),
];
return { propertyDetailUrls: urls };
})();Site-Specific Gotchas
- The directory uses property links under the
/properties/{slug}path; exclude the directory root/propertiesitself. - A property may appear in multiple page elements, so deduplicate URLs.
- Normalize relative links to absolute URLs and remove trailing slashes, query strings, and fragments for canonical output.
- Scrolling to the bottom is useful before extraction if the directory defers rendering listing cards until they enter or approach the viewport.
Expected Output
An object of the form { "propertyDetailUrls": ["https://www.fourfrontrep.com/properties/{slug}", "..."] }, containing one canonical absolute URL per listed property.