A highly concurrent web crawler and markdown extractor
Project description
FetchIt
FetchIt downloads web documentation and converts it to a single Markdown file.
Features
- Downloads multiple pages at the same time.
- Removes headers, footers, sidebars, and menus.
- Converts HTML to standard Markdown.
- Saves images locally and updates links.
- Detects programming languages automatically.
- Saves progress to resume later.
- Uses C++ for fast parsing.
Installation
Prerequisites
- Python 3.8 or newer
- C++ compiler (like GCC or Clang)
makeutility
Arch Linux
Install using yay from the AUR:
yay -S fetchit-git
System-Wide Installation (Other Systems)
Use make to install system-wide.
sudo make install
To remove the program later:
sudo make uninstall
Local Virtual Environment
Use a virtual environment to avoid system conflicts.
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
Run the tool from the command line.
fetchit <URL> -o <OUTPUT_FILE> -c <CONCURRENCY> -r <RETRIES>
- Run
fetchitwithout arguments to see the help menu. - The C++ extension compiles automatically on the first run.
Options
| Option | Description | Default |
|---|---|---|
URL |
Starting website address | Required |
-o, --output |
Output file name | output.md |
-c, --concurrency |
Maximum pages to download at once | 10 |
-r, --retries |
Number of retries for failed downloads | 3 |
--no-images |
Skip downloading images and use remote URLs | Disabled |
--tree |
Save output as a directory tree of markdown files | Disabled |
--verbose |
Print detailed debug logs | Disabled |
-v, --version |
Print the current version | Disabled |
Note on
--no-images: This flag skips downloading image files to your local disk, but the images are still embedded in the Markdown using their original absolute web URLs (e.g.,). This means the images will still load and display when you view the Markdown online or in an editor, as long as you have an active internet connection!
Example
fetchit https://developer.android.com/compose -o compose.md -c 20
- Crawls the Android Compose documentation.
- Downloads 20 pages at a time.
- Saves output to a single file
compose.md. - Saves images in the
images/directory.
Directory Tree Example
You can save the documentation as a file tree instead of a single markdown file:
fetchit https://developer.android.com/compose -o docs --tree
This will create a docs/ folder containing the file structure:
docs/
|- compose/
| |- index.md
| |- setup.md
| |- ui/
| |- button.md
Architecture
- C++ Extension: Parses sitemaps and checks URLs quickly.
- Python Crawler: Manages network requests and retries.
- Python Extractor: Cleans HTML and converts it to Markdown.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fetchit_md-0.0.4.tar.gz.
File metadata
- Download URL: fetchit_md-0.0.4.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0057a3a89c69bf72993f39f595f05fe748b2b04bfdb7b6b222955fd02893de2e
|
|
| MD5 |
2cef2d1bac461fd709ab15ca7c17a1df
|
|
| BLAKE2b-256 |
4058057e890aa879ddf8ae10fa7db77ca1bc72590206e56d019188bc00d5c755
|