thiladhun scrapper to green

This commit is contained in:
Mohamed jinas
2024-01-06 15:37:59 +05:00
parent 69c05d9471
commit 1b56bcb510
5 changed files with 24 additions and 18 deletions

View File

@@ -9,8 +9,8 @@ class ThiladhunFeed implements Feed
public function __construct()
{
$this->client = new Client();
}
$this->client = new Client();
}
/**
* Get all the latest news
*
@@ -18,7 +18,7 @@ class ThiladhunFeed implements Feed
*/
public function get() : array
{
$crawler = $this->client->request('GET', "https://www.thiladhun.com");
$feeds = [];
@@ -31,9 +31,9 @@ class ThiladhunFeed implements Feed
"date" => $node->filter('time')->first()->attr('datetime')
];
});
});
return $feeds;
}
}
}

View File

@@ -39,8 +39,8 @@ class ThiladhunScraper
$crawler = $this->client->request('GET', $url);
$crawler->filter('h1')->each(function ($node) {
$this->title = $node->text();
$crawler->filter('meta[property="og:title"]')->each(function ($node) {
$this->title = $node->attr('content');
});
@@ -58,7 +58,7 @@ class ThiladhunScraper
"slug" => basename($node->attr('href'))
];
}
});
$crawler->filter('a > .elementor-post-info__item--type-author')->each(function ($node) {