Skip to main content

Mirrors online website or assets easily for archiving etc.

Project description

PyWebCopy ©

Created By : Raja Tomar License : MIT

Website mirroring and archiving tool written in Python Archive any online website and its assets, css, js and images for offilne reading, storage or whatever reasons. It's easy with pywebcopy.

Why it's great? because it

  • respects robots.txt
  • have a single function basic usages
  • lots of configuration for your custom need
  • many utils and generator functions to ease your life

Email me at of any query :)


pywebcopy is available on PyPi and is easily installable using pip

pip install pywebcopy

Basic Usages

To mirror any single page, just type in python console

from pywebcopy.core import init


that's it.

You will now have a folder in C: drive C:\WebCopyProjects\\\

Just browse it as would on any browser!


pywebcopy is highly configurable.

To change any configuration, just pass it to the init call.


from pywebcopy.core import init

    url='', # required
    # config keys are case insensitive
    # add many as you want :)


List of available configurations

below is the list of config keys with their default values :

# writes the log file content to console directly
'DEBUG': False  

# make zip archive of the downloaded content

# delete the project folder after making zip archive of it
'CLEAN_UP': False

# to download css file or not
'LOAD_CSS': True

# to download images or not

# to download js file or not

# to download every page available inside 
# url tree turn this True
# NOTE: This could overload the server and could 
# result in ip ban
'COPY_ALL': False

# to overwrite the existing files if found

# list of allowed file extensions
'ALLOWED_FILE_EXT': ['.html', '.css', '.json', '.js',
                     '.xml','.svg', '.gif', '.ico',
                      '.jpeg', '.jpg', '.png', '.ttf',
                      '.eot', '.otf', '.woff']

# file to write all valid links found on pages

# log file path
'LOG_FILE': None

# compress log by removing unnecessary info from log file

# log buffering store log in ram until finished, then write to file
# Turning it on can reduce task completion time

# log buffer holder for performance speed up
# Can change this to your preferable cache provider :)

# name of the mirror project

# url to download
'URL': None

# define the base directory to store all copied sites data
'MIRRORS_DIR': C:\WebCopyProjects\ + Project_Name

# all downloaded file location
# available after any project completion

# NOTE: Do not change unless you know what you're doing

# pattern is used to check file name supported by os FS
'FILENAME_VALIDATION_PATTERN': re.compile(r'[*":<>\|\?]+')

# user agent to be shown on requests made to server
'USER_AGENT' : Mozilla/4.0 (compatible; WebCopyBot/X.X;

# bypass the robots.txt restrictions

told your there were plenty of config available!

Undocumented Features

I built many utils and classes in this project to ease the tasks I was trying to do.

But, these task are also suitable for general purpose use.

So, if you want, you can help in generating suitable documentation for these undocumented ones, then you can always email me.


For any queries related to this project you can email me at

You can help in many ways:

  • reporting bugs
  • sending me patches to fix or improve the code
  • in generating the complete documentation of this project


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pywebcopy, version 1.9
Filename, size File type Python version Upload date Hashes
Filename, size pywebcopy-1.9.tar.gz (15.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page