Python 3 Selenium Web Scraping Script to Take Screenshot of Website URL and Download it as PNG Image File Full Project For Beginners

You are currently viewing Python 3 Selenium Web Scraping Script to Take Screenshot of Website URL and Download it as PNG Image File Full Project For Beginners

 

Welcome folks today in this post we will be fetching screenshot of website url and download it as png image file using selenium library in python .All the full source code of application is shown below.

 

 

 

Get Started

 

 

In order to get started we need to install the following library using the pip command as shown below

 

pip install selenium

 

pip install chromedriver_binary==XX.X.XXXX.XX.X

 

Where you will put your chrome version number inside xx characters

 

After this you need to make an app.py file and copy paste the following code

 

app.py

 

 

 

 

Now to run this python script using the command line you will pass an additional command line argument which will be the url of the website to download the screenshot of the image as png file

 

python app.py https://www.google.com

 

Now it will download the google.com website screenshot as shown below in the same directory

 

 

 

 

 

Leave a Reply