From ec5a26f78be6eddebae2bee873352c1fdd2b12ae Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 25 Jun 2026 13:22:03 +0200 Subject: [PATCH] Actualiser api.php --- api.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api.php b/api.php index 30b2735..bdc299f 100644 --- a/api.php +++ b/api.php @@ -589,6 +589,23 @@ switch ($action) { // Essai avec d'autres sélecteurs courants $diag['alt1_h2_links'] = $xpath->query('//h2//a/@href')->length; + $h2Links = $xpath->query('//h2//a'); + $diag['h2_links_list'] = []; + foreach ($h2Links as $a) { + $diag['h2_links_list'][] = [ + 'text' => trim($a->textContent), + 'href' => $a->getAttribute('href') + ]; + } + + // Et les imgs disponibles dans la page + $allImgs = $xpath->query('//img/@src'); + $diag['img_samples'] = []; + $i = 0; + foreach ($allImgs as $img) { + if ($i++ >= 15) break; + $diag['img_samples'][] = $img->nodeValue; + } $diag['alt2_figure_imgs'] = $xpath->query('//figure//img/@src')->length; $diag['alt3_any_article'] = $xpath->query('//article')->length; }