Skip to main content

Description

The NightCrawler is site crawling/spider tool to gather links at the given domain by walking through the whole site and generating simple sitemap.

Limitations

This tools is just a demo. It’s single-threaded script that walks every page it gets and it’s not optimized for speed.

The script sticks to the url provided and does not dive into subdomains of the given domain even if encounters internal redirect like example.com -> www.example.com

Possible enhancements

  • Use multi-threading with thread pools

  • Use generators to lower memory footprint and gain a bit more speed

  • Make preliminary HEAD request to distinguish between text and binary files

  • Check Content-Type and exclude files that are not HTMLs

  • Add matchers and sitemap generators for additional sitemap flavour (images, videos, etc.)

  • More tests (already included tests are only for the most critical classes)

Installation

1. Requirements

  1. Python >= 3.2

  2. PIP

2a. Installation without virtualenv

Run the following command in shell:

pip install NightCrawler

2b. Installation in virtualenv

Run the following command in shell:

virtualenv .env
. .env/bin/activate
pip install NightCrawler

2c. Installation from source (development)

To install the package from source one have to create virtualenv after cloning the repository

git clone https://github.com/szczad/NightCrawler.git
cd NightCrawler
virtualenv .env
. .env/bin/activate
pip install -e ./

3. (optional) Testing

When installed from sources in development mode the script can be tested with the following command

. .env/bin/activate
python setup.py test

Running the script

0. Help

nightcrawler --help

1. Running the script installed globally

nightcrawler <url|domain>

2. Running the script installed in virtualenv

<path_to_virtualenv>/bin/nightcrawler <url|domain>

or

. .env/bin/activate
nightcrawler <url|domain>

Release files for NightCrawler 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for NightCrawler 0.1.6
File Size Uploaded
NightCrawler-0.1.6.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for NightCrawler 0.1.6
File Interpreter ABI Platform
NightCrawler-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / NightCrawler-0.1.6.tar.gz

Download URL NightCrawler-0.1.6.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
85bbcaeeb7817c88c542278047ce7d92628f29905a19b8b1b1cf0798e5488ef9
BLAKE2b-256 checksum
How to use checksums
e0e7e87f6beee9f249e9ddcae247c835762b598685607036f6ccec61fc41efbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.15

Release files / NightCrawler-0.1.6-py3-none-any.whl

Download URL NightCrawler-0.1.6-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f7ef6472322297c6faa4cee16e74688bd791844dfc8ed924c1e53638dd1b11c
BLAKE2b-256 checksum
How to use checksums
761c3f936abbd8adda5863dbcf7d2e432ccd9d544481e8a0a661521599e47014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.15

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page