From bba8f97bbe650ed2f8e90d802efdefaf81db26ac Mon Sep 17 00:00:00 2001 From: Peter Foster Date: Sat, 14 Feb 2026 18:36:16 +0000 Subject: [PATCH] Fix: Sell2Wales direct URL to use search_view.aspx with ID parameter --- scrapers/sell2wales.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scrapers/sell2wales.js b/scrapers/sell2wales.js index 5a3ee9d..a872b0c 100644 --- a/scrapers/sell2wales.js +++ b/scrapers/sell2wales.js @@ -67,16 +67,16 @@ async function scrapeTenders() { const title = link.text().trim(); if (!title || title.length === 0) continue; - const noticeUrl = release.url || ('https://sell2wales.gov.wales/Search/notice/' + sourceId); + // Extract reference number from URL first + const idMatch = href.match(/ID=([A-Z0-9]+)/); + const sourceId = idMatch ? idMatch[1] : ('s2w_' + Date.now() + '_' + i); + + const noticeUrl = 'https://sell2wales.gov.wales/search/search_view.aspx?ID=' + sourceId; // Get the parent container for this tender const container = link.closest('div, li, tr'); const containerText = container.text(); - // Extract reference number from URL - const idMatch = href.match(/ID=([A-Z0-9]+)/); - const sourceId = idMatch ? idMatch[1] : ('s2w_' + Date.now() + '_' + i); - // Extract metadata const refMatch = containerText.match(/Reference no:\s*([A-Z0-9]+)/i); const finalRef = refMatch ? refMatch[1] : sourceId;