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

x1m's avatar
Level 3

Grabbing HTML page from URL, then parse it to readable text

Hey guys,

Working on a little side project. I've got a cute little frontend with a single form field in which you can put a URL. When pressing submit it should send the HTML to a controller, then run through a DOMParser (using ammadeuss/laravel-html-dom-parser atm).

After that it should spit out a 'result' page with a readable, stripped version of the HTML page provided with the URL before in the form field.

I'm a bit stuck on the logic here, PHP/Laravel wise.

Any suggestions on how to do this? Have not worked with Dom parser before

0 likes
2 replies
Snapey's avatar

You should probably pass the URL to the server, then use something like guzzle at the server to request the data.

You can then pass the response into the parser

Please or to participate in this conversation.