new features
This commit is contained in:
@@ -733,7 +733,7 @@ async function scrapeAusbildungenFromDetailPage(
|
||||
return [];
|
||||
}
|
||||
|
||||
const url = `${BASE_URL}/fdisk/module/mgvw/ausbildungen/AusbildungenListEdit.aspx`
|
||||
const url = `${BASE_URL}/fdisk/module/mgvw/kursteilnehmer/KursteilnehmerListEdit.aspx`
|
||||
+ `?search=1&searchid_mitgliedschaften=${idMitgliedschaft}&id_personen=${idPersonen}`
|
||||
+ `&id_mitgliedschaften=${idMitgliedschaft}&searchid_personen=${idPersonen}&searchid_maskmode=`;
|
||||
|
||||
@@ -1084,7 +1084,35 @@ async function scrapeMemberUntersuchungen(
|
||||
}).catch(() => null);
|
||||
|
||||
if (hasHistoryLink) {
|
||||
log(` → Found history link: ${hasHistoryLink}`);
|
||||
log(` → Found history link: ${hasHistoryLink}, navigating...`);
|
||||
// Try to click or navigate to the history page for more complete data
|
||||
try {
|
||||
const navigated = await frame.evaluate(() => {
|
||||
const links = Array.from(document.querySelectorAll('a, input[type="button"], button'));
|
||||
for (const el of links) {
|
||||
const text = (el.textContent || '').toLowerCase();
|
||||
const title = (el.getAttribute('title') || '').toLowerCase();
|
||||
if (text.includes('verlauf') || text.includes('historie') || text.includes('alle anzeigen')
|
||||
|| title.includes('verlauf') || title.includes('historie')) {
|
||||
if ((el as HTMLAnchorElement).href) {
|
||||
return (el as HTMLAnchorElement).href;
|
||||
}
|
||||
(el as HTMLElement).click();
|
||||
return 'clicked';
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}).catch(() => null);
|
||||
if (navigated && navigated !== 'clicked') {
|
||||
await frame_goto(frame, navigated);
|
||||
} else if (navigated === 'clicked') {
|
||||
await frame.waitForNavigation({ timeout: 5000 }).catch(() => {});
|
||||
}
|
||||
await selectAlleAnzeige(frame);
|
||||
await dumpHtml(frame, `untersuchungen_history_StNr${standesbuchNr}`);
|
||||
} catch (e) {
|
||||
log(` → Failed to follow history link: ${e}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Parse the table using navigateAndGetTableRows logic (reuse existing page state)
|
||||
@@ -1262,10 +1290,19 @@ async function scrapeMemberFahrgenehmigungen(
|
||||
|
||||
// If form-field approach found rows, use them
|
||||
if (rawRows.length > 0) {
|
||||
const VALID_LICENSE_CLASSES = new Set([
|
||||
'A', 'A1', 'A2', 'AM', 'B', 'B1', 'BE', 'C', 'C1', 'CE', 'C1E',
|
||||
'D', 'D1', 'DE', 'D1E', 'F', 'G', 'L', 'T',
|
||||
]);
|
||||
const results: FdiskFahrgenehmigung[] = [];
|
||||
for (const row of rawRows) {
|
||||
const klasse = cellText(row.klasse);
|
||||
if (!klasse) continue;
|
||||
// Validate klasse against whitelist — skip non-class data
|
||||
if (!VALID_LICENSE_CLASSES.has(klasse.toUpperCase())) {
|
||||
log(` → Skipping invalid klasse: "${klasse}"`);
|
||||
continue;
|
||||
}
|
||||
const ausstellungsdatum = parseDate(row.ausstellungsdatum);
|
||||
const syncKey = `${standesbuchNr}::${klasse}::${ausstellungsdatum ?? ''}`;
|
||||
results.push({
|
||||
|
||||
Reference in New Issue
Block a user