How to capture screenshot of website with a URL using PHP

In this post, we gonna write a simple PHP script to grab given website URL screenshot. So let’s create an HTML form to collect URL form the user.

HTML Form

We have just created a simple form with one field called URL and submit button. Submit button is to send the request to the server. Form action is pointed to screenCaptureFromURL.php, so lets create screenCaptureFromURL.php file.

PHP script to generate screenshot for a given URL

We gonna use google apis to grap the website screenshot and code is commented pretty well, just through the comments for better understanding.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

DMCA.com Protection Status