Open In App

How to Clone webpage Using pywebcopy in Python?

Improve
Improve
Like Article
Like
Save
Share
Report

Sometimes we need a handy web page on your local hard drive. So, here we are going to write a simple Python script to Scrap a web page. Web scraping is used for extracting data from websites for offline reading, storage, or whatever reason. Before writing the script we need to know pywebcopy. pywebcopy is available on PyPi and is easily installable using pip. Type the below command in the terminal to install this module

pip install pywebcopy

pywebcopy  Python package for cloning complete web pages and websites to local storage.

Approach:

  • Import pywebcopy
  • Pass the argument into the save_webpage(url=”…”,project_folder=”path/download”,kwargs)
  • Check on your given location.
     

Below is the implementation.

Python3




from pywebcopy import save_webpage
 
kwargs = {'project_name': 'site folder'}
 
save_webpage(
   
    # url of the website
     
    # folder where the copy will be saved
    project_folder='F:/ro/geek',
    **kwargs
)


 
Output:

python clone website

The complete clone of the webpage is made and stored in the specified location. 


Last Updated : 17 Aug, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads