Git Product home page Git Product logo

sitemaper's Introduction

sitemaper 🕸️🦾

sitemaper is a Python tool for creating sitemaps by crawling a specified website. It generates a sitemap in XML format that includes the URLs and titles of all the pages within the site.

Open Issues License: MIT

Installation

To install sitemaper, you clone the repository and install it using pip. Run the following commands:

pip install git+https://github.com/tabee/sitemaper.git

Or you start with GitHub Codespaces:

Open in GitHub Codespaces

Usage

You can use sitemaper in your Python scripts as follows:

from sitemaper.main import Datasource, make_sitemap

source_01 = Datasource(
    'https://www.bee-gu.ch',
    'sitemap__bee_gu_ch.xml',
    ["#", "mailto:"],
    [".html", "https://www.bee-gu.ch"])

try:
    make_sitemap(source_01.base_url, source_01.filename,
                    source_01.exclude, source_01.must_include)
except Exception as e:
    print("An error occurred:", e)

This script will crawl the website at the specified base URL and build a sitemap, which is saved to the specified file. The exclude and must_include parameters are lists of URL substrings to exclude from or require in the sitemap, respectively.

License

This project is licensed under the MIT License - see the LICENSE file for details.

sitemaper's People

Contributors

tabee avatar

Watchers

 avatar

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.