client = new Client(); } /** * Get all the latest news * * @return array */ public function get() : array { $crawler = $this->client->request('GET', "https://www.thiladhun.com"); $feeds = []; // Assuming 'ފަހުގެ' is a unique identifier for the section of interest $crawler->filter('.elementor-element:contains("ފަހުގެ")')->nextAll('.elementor-post')->each(function ($node) use (&$feeds) { $title = $node->filter('.elementor-heading-title a')->count() ? $node->filter('.elementor-heading-title a')->text() : null; $link = $node->filter('.elementor-heading-title a')->count() ? $node->filter('.elementor-heading-title a')->attr('href') : null; if ($title && $link) { $feeds[] = [ "title" => $title, "link" => $link, ]; } }); return $feeds; } }