A simple and efficient web crawler in Python.
Project description
Tiny Web Crawler
A simple and efficient web crawler in Python.
Features
- Crawl web pages and extract links starting from a root URL and extract all the links found on each page
- Handle relative and absolute URLs
- Save the results of your crawl in a structured JSON format for easy analysis and processing
- Designed with simplicity in mind, making it easy to use and extend for various web crawling tasks
Installation
Install using pip:
pip install tiny-web-crawler
Usage
from tiny_web_crawler.crawler import Spider
root_url = 'http://github.com'
max_links = 2
spider = Spider(root_url, max_links)
spider.start()
Output Format
Crawled output sample for https://github.com
{
"http://github.com": {
"urls": [
"http://github.com/",
"https://githubuniverse.com/",
"..."
],
"https://github.com/solutions/ci-cd": {
"urls": [
"https://github.com/solutions/ci-cd/",
"https://githubuniverse.com/",
"..."
]
}
}
}
License
MIT License
Copyright (c) 2024 Indrajith Indraprastham
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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
tiny_web_crawler-0.1.5.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for tiny_web_crawler-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb10d67b7349c69015ad26f0ebc88f19a7ca7802a0bb98ec8810e81d046ee9cc |
|
MD5 | 297e66c6c5844c7ee266ca0a73a9e1b0 |
|
BLAKE2b-256 | b3a26aed6e3b5ff1704cd7cc311db082306f783231b82742e5e7d21c3a78e7a6 |