Find Featured Property Detail Links

Site alpinesouthproperties.comTask find-featured-property-detail-linksVersion v2Updated Nov 6, 2026Category real-estate

Extract each featured property's name and unique same-site detail URL from Alpine South Properties portfolio pages. This skill was captured from a live agent session on alpinesouthproperties.com and is published here as a reusable recipe for agents.

NoteSelectors and URL schemes drift as sites change. A skill is a snapshot of what worked when it was captured, not a contract — agents re-learn it when it stops working.

Extract featured property names and deduplicated same-site detail URLs from the portfolio gallery, excluding portfolio navigation, PDFs, external links, and fragments.

Use Cases

  • List featured properties from /portfolio.
  • Return property names paired with their detail-page URLs.
  • Exclude /s/ PDF resources and duplicate image/title links.
  • Handle Squarespace layouts where the heading and gallery occupy separate sections.

Automation Flow

  1. Navigate directly to https://www.alpinesouthproperties.com/portfolio.
  2. In the same browser call, run this evaluator:
(() => {
  const clean = s => (s || '').replace(/\s+/g, ' ').trim();
  const heading = [...document.querySelectorAll('h1,h2,h3,h4,h5,h6,[role="heading"]')]
    .find(el => /^Featured\s+Properties(?:\s+Page\s+\d+)?\b/i.test(clean(el.textContent)));
  if (!heading) return {sectionFound: false, properties: []};

  const valid = a => {
    if (!a || a.closest('header,footer,nav')) return null;
    let u;
    try { u = new URL(a.href, location.href); } catch (_) { return null; }
    const path = u.pathname.replace(/\/$/, '') || '/';
    if (u.origin !== location.origin || u.hash || path === '/portfolio' || path.startsWith('/s/')) return null;
    return u.href.replace(/\/$/, '');
  };
  const nameFor = a => {
    const direct = clean(a.textContent || a.getAttribute('aria-label') || '');
    if (direct) return direct;
    const parent = a.closest('.sqs-gallery-design-grid-slide,article,li,figure');
    const h = parent && parent.querySelector('h1,h2,h3,h4,h5,h6,[role="heading"]');
    if (h && clean(h.textContent)) return clean(h.textContent);
    const img = a.querySelector('img[alt]');
    return clean((img && img.alt || '').replace(/\s*\(\d+\)\s*(?=\.\w+$)/, '').replace(/\.(png|jpe?g|webp|gif|svg)$/i, ''));
  };
  const candidates = root => [...root.querySelectorAll('a[href]')]
    .map(a => ({a, href: valid(a)}))
    .filter(x => x.href && (x.a.querySelector('img') || clean(x.a.textContent || x.a.getAttribute('aria-label'))));

  let scope = null;
  let node = heading;
  while (node && node !== document.body) {
    const found = candidates(node);
    if (found.length >= 4) { scope = node; break; }
    node = node.parentElement;
  }
  if (!scope) scope = document.body;

  const properties = [];
  const seen = new Set();
  for (const {a, href} of candidates(scope)) {
    if (seen.has(href)) continue;
    seen.add(href);
    properties.push({name: nameFor(a), href});
  }
  return {sectionFound: true, properties};
})()

Params

ParamWhat it doesExample value
portfolio URLLoads the page containing the featured-property galleryhttps://www.alpinesouthproperties.com/portfolio
heading patternLocates the Featured Properties content area^Featured\s+Properties
excluded path prefixRemoves portfolio PDF resources/s/

Possible Friction Points

TriggerAction
Heading and gallery are in separate Squarespace sectionsWalk up the DOM to the smallest ancestor containing at least four valid gallery candidates instead of using only the heading's section.
Image and title anchors duplicate one propertyNormalize trailing slashes and deduplicate URLs with a Set.
A card has no visible textThe name falls back to the image alt text minus its file extension, which can be a filename unrelated to the property (e.g. 480 Greenway Drive Portfolio → /brainerdmarket); treat the URL slug as the reliable identifier.
Portfolio has no pagination controlsTreat the loaded portfolio as the complete collection; do not add pagination requests.
Featured Properties heading is absent or renamedReturn sectionFound: false and inspect the current heading text before changing the pattern.

Example Result

{
  "sectionFound": true,
  "properties": [
    {
      "name": "Example Title",
      "href": "https://example.com/property-one"
    },
    {
      "name": "Example Property",
      "href": "https://example.com/property-two"
    }
  ]
}

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=alpinesouthproperties.com&task=find-featured-property-detail-links