Sangu scraper boiler plate
This commit is contained in:
		
							
								
								
									
										23
									
								
								app/Services/Feeds/SanguFeed.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								app/Services/Feeds/SanguFeed.php
									
									
									
									
									
										Normal 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']);             
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user