find('div.contentListCards', 0)->find('a[data-test=type-story]') as $element) { $headline = ($element->find('.headline', 0))->innertext; $timestamp = ($element->find('time', 0))->datetime; $articleUri = 'https://www.cbc.ca' . $element->href; $summary = ($element->find('div.description', 0))->innertext; $thumbnailUris = ($element->find('img[loading=lazy]', 0))->srcset; $thumbnailUri = rtrim(explode(',', $thumbnailUris)[0], ' 300w'); // Fill item $item = []; $item['uri'] = $articleUri; $item['id'] = $item['uri']; $item['timestamp'] = $timestamp; $item['title'] = $headline; $item['content'] = '
' . $summary; $item['author'] = 'Editor\'s Blog'; if (isset($item['title'])) { $this->items[] = $item; } } } }