collectExpandableDatas($url, 40);
}
protected function parseItem(array $item)
{
$article = '';
try {
$articlePage = getSimpleHTMLDOM($item['uri']);
} catch (HttpException $e) {
// 403 Forbidden, This means we got anti-bot response
if ($e->getCode() === 403) {
return $item;
}
throw $e;
}
// handle subtitle
$subtitle = $articlePage->find('p.css-w6ymp8', 0);
if ($subtitle != null) {
$article .= '' . $subtitle->plaintext . '';
}
// figure contain's the main article image
$article .= $articlePage->find('figure', 0) . '
';
// section.meteredContent has the actual article
foreach ($articlePage->find('section.meteredContent p') as $element) {
$article .= '' . $element . '';
}
$item['content'] = $article;
return $item;
}
}