Auto-deploy: 2026-06-05 22:51:59
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
summary: ''
|
||||
};
|
||||
|
||||
try {
|
||||
// 1. Extract Name (Prioritize links over generic spans)
|
||||
const profileLinks = Array.from(cardEl.querySelectorAll('a[href*="/in/"]'))
|
||||
.filter(a => a.innerText.trim().length > 2 && !a.innerText.includes('LinkedIn'));
|
||||
@@ -82,6 +83,17 @@
|
||||
if (lines.length > 1 && !data.headline) data.headline = lines[1];
|
||||
}
|
||||
|
||||
// Final fallback to avoid empty name
|
||||
if (!data.name) {
|
||||
data.name = 'مستثمر محتمل';
|
||||
data.summary = cardEl.innerText ? cardEl.innerText.substring(0, 300) : '';
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[LJA] Extraction failed', e);
|
||||
data.name = 'مستثمر محتمل';
|
||||
data.summary = cardEl.innerText ? cardEl.innerText.substring(0, 300) : '';
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -197,7 +209,8 @@
|
||||
|
||||
const data = extractPersonData(cardEl);
|
||||
if (!data.name && !data.headline) {
|
||||
alert('Could not extract person details.');
|
||||
console.error('[LJA] Could not extract details, skipping.');
|
||||
btnEl.innerHTML = '❌ Extraction Failed';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user