Purpose
Find canonical nepremicninskioglasnik.com listing URLs for a natural-language property query without manually opening result cards or guessing opaque listing UUIDs.
When to Use
Use when the caller has a property search description such as room count, municipality, neighborhood, or other listing criteria, but does not already have the listing's canonical URL or UUID.
Workflow
- Build the single search URL
https://www.gohome.si/nepremicnine.aspx?q={encodeURIComponent(query)}and navigate there with the Browserless Agent. - On the loaded results page, run this evaluator to enumerate result links and decode GoHome's redirect payload:
(() => {
const decode = (s) => {
try {
const raw = atob(s.replace(/-/g, "+").replace(/_/g, "/"));
const bytes = Uint8Array.from(raw, (c) => c.charCodeAt(0));
return new TextDecoder().decode(bytes);
} catch (_) {
return null;
}
};
return [...document.querySelectorAll('a[href*="RedirectToReal.aspx"]')]
.map((a) => {
const u = new URL(a.href, location.href);
const encoded = u.searchParams.get("data");
let payload = null;
let targetUrl = null;
if (encoded) {
try {
payload = JSON.parse(decode(encoded));
targetUrl = payload.Izvor || null;
} catch (_) {}
}
return {
text: a.innerText.trim(),
redirectUrl: a.href,
targetUrl,
targetPath: targetUrl ? new URL(targetUrl).pathname : null,
listingId: targetUrl
? (targetUrl.match(/[0-9a-f]{8}-[0-9a-f-]{27,}/i) || [])[0] || null
: null,
sourcePayload: payload,
};
})
.filter((x) => x.targetUrl);
})();- Select the candidate whose visible text and decoded
targetUrlbest match{query}. Navigate directly to that decodedtargetUrl; do not revisit the GoHome redirect URL. The decoded URL contains the canonical path and opaque listing identifier.
Site-Specific Gotchas
- GoHome is the search surface used for these listings; the target site does not need to be visited first.
- Result links use
/RedirectToReal.aspx?data=...;datais URL-safe/base64-encoded JSON. The canonical target is stored in the JSONIzvorfield. - Never invent a listing UUID. Resolve it from a matching result and then use the decoded
targetUrl. - Search result labels can contain localized room-count, city, and neighborhood text, so match semantically rather than relying on one fixed label.
- The redirect payload may include tracking fields; only
Izvoris needed for direct navigation.
Expected Output
An ordered array of matching candidates containing text, redirectUrl, decoded canonical targetUrl, targetPath, and listingId; after selection, the canonical targetUrl is the URL to review or pass to downstream processing.