Coder Social home page Coder Social logo

copy-website's Introduction

Copy-Website Python script

Crawls through the 'wget' output of a website and organizes it into folders for easy deployment.

Installing Pre-requisites

Python 2 or 3

Copy-Website is tested to work with Python 2.7.6 and Python 3.4.0 in Linux and Windows.

For installing python, check out their downloads page.

Beautiful Soup

Copy-Website requires Beautiful Soup for screen scraping. You can download this package using pip or easy_install as follows:

pip install beautifulsoup4
easy_install beautifulsoup4
Wget output

The scripts operates on output files of 'wget', a computer program that retrieves content from web servers. To generate these files, you can run wget-script.sh in copy-website folder.

Running

Before running the script, you need to specify paths to source and the destination folders. Source folder must contain the output files of 'wget'. Destination folder is where you want to generate the organized website. In addition, you need to specify the path to the css folder in the source. You can now run the script using the command in the copy-website folder:

python run.py

Customizing the script

Copy-Website script parses the html files using a layer-based architecture. In each layer, it searches for certain patterns in links and crawls into the web pages to find more links recursively. At each recursion, it organizes the layer into folders forming a tree structure of website.

This script by default works only with the output of wget-script.sh. To modify this script to suit a required website, you can customize parsing and helper functions to set the patterns you search for in the links.

copy-website's People

Contributors

jayadeepk avatar

Forkers

ra2003

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.