Actualiser api.php
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user