Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nagavinod424's avatar

Url Scraping like facebook in Laravel 5.3

Hello Guys i am using https://github.com/FriendsOfPHP/Goutte to scrape urls like facebook in laravel 5.3 but my trails are failing i had tried both http and https urls http gives a empty result and htttps gives curl 60 error can anyone help me, i have the following code in my routes.

use Illuminate\Http\Request; use Goutte\Client; Route::get('getFromUrl',function (Request $request){ if(Auth::check()){ $client = new Client(); $url = $request->url; $crawler = $client->request('GET', $url); return response()->json($crawler); } });

0 likes
1 reply
bobbybouwmann's avatar

Did you completely checkout the readme?

The method returns a Crawler object (Symfony\Component\DomCrawler\Crawler).

I don't think you can covert the object to json here!

Please or to participate in this conversation.