Sangu scraper boiler plate

This commit is contained in:
2020-08-15 02:24:57 +05:00
parent 35e96947d9
commit 7d4815fcfa
2 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Services\Feeds;
use Goutte\Client;
class SanguFeed
{
protected $client;
public function __construct()
{
$this->client = new Client();
}
public function get()
{
$crawler = $this->client->request('GET', "http://sangu.mv/");
return $crawler->filter('div[class*="large-5 medium-4 large-pull-7 medium-pull-8 small-12 columns"] .news-list .list-title a')
->extract(['_text', '_attr' => 'href']);
}
}