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

bennie's avatar

Web Scraping / Goutte - Intercept Download or a different method?

Hi All,

A fast question for you. I have a small project in which I need to screen scrape ( well actually download a file ) into php/laravel.

A quick google search pointed me to FriendsOfPhp/Goutte.

I've successfully managed to get Goutte to authenticate, hit a URL, change a select field and click a submit button.

The page then reloads and as it finishes loading, it downloads a file to the client.

How do I intercept this file within Goutte? I've read as much doco as I can but can't seem to find an answer. I then want to basically hit this file, traverse it and save it locally.

Depending upon the file type, I want to traverse it, or save it locally.

Or another recommended method? Unfortunately, the website I need to hit does not have an API :-(

Thanks in advance!

0 likes
0 replies

Please or to participate in this conversation.