FriendsOfPHP / Goutte

Goutte, a simple PHP Web Scraper
MIT License
9.26k stars 1.01k forks source link

view instead of url #471

Open merdalina opened 2 years ago

merdalina commented 2 years ago

how can i use in laravel and instead of using an external url, use an internal view?

abdulmeLINK commented 1 year ago

As I understand, You want to parse your .blade.php view resources into DOM. For this problem you can send request to your own server:

use Goutte\Client; ... $client = new Client(); $crawler = $client->request('GET', route('routeName'));

Or you can use crawler directly wtih file_get_contents function as described in this thread