Skip to content

Commit 4bbc67e

Browse files
committed
fix: improve technical specs matchers
1 parent 5fed5e6 commit 4bbc67e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/HtmlPieces.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,25 @@ public function get(object $page, string $element, string $url='')
338338
{
339339
$row = $dom->find($page, "#$itemId");
340340
$row_title = $row->find(".ipc-metadata-list-item__label")->text(true);
341-
$row_value = $row->find('.ipc-metadata-list-item__content-container')->text(true);
341+
$row_value_container = $row->find('.ipc-metadata-list-item__content-container');
342+
$row_value_list = $row_value_container->find('li');
343+
$row_value = '';
344+
if ($this->count($row_value_list) > 0) {
345+
foreach ($row_value_list as $list_item)
346+
{
347+
$list_item_value = $list_item->find('.ipc-metadata-list-item__list-content-item');
348+
$list_item_subtext = $list_item->find('.ipc-metadata-list-item__list-content-item--subText');
349+
if ($this->count($list_item_value) > 0) {
350+
$delimiter = '|';
351+
$textToAdd = $list_item_value->text(true);
352+
if ($this->count($list_item_subtext) > 0) $textToAdd = "$textToAdd " . $list_item_subtext->text(true);
353+
if ($this->count($row_value) > 0) $textToAdd .= " $delimiter $textToAdd";
354+
$row_value .= $textToAdd;
355+
}
356+
}
357+
} else {
358+
$row_value = $row_value_container->text(true);
359+
}
342360
$row = [
343361
$this->strClean($row_title),
344362
$this->strClean($row_value)

0 commit comments

Comments
 (0)