Skip to main content

Site Sniffer in Python 🐽

PyPi version Python 3.10+ PyPI Downloads Github contributors Code Size License: MIT

Site Sniffer is a Python package designed to extract information about a website by providing its URL. It is useful for individuals who need to perform website analysis, including web developers, SEO specialists, and website owners. The package extracts various details such as the IP address, HTTP status code, SSL certificate information, domain registration details, load time, meta description, keywords, and a list of links on the page.

Installation

Install sitesniffer with pip:

pip install sitesniffer

Alternatively:

pip install git+https://github.com/thisisjsimon/SiteSniffer.git

Usage

Make sure that you have installed Python 3.10 or higher before proceeding.

To use SiteSniffer, you need to import it first:

from sitesniffer import SiteSniffer

Then, create an instance of the SiteSniffer class by providing the URL of the website you want to analyze:

sniffer = SiteSniffer('https://example.com')

You can then call the methods of the SiteSniffer object to get various details about the website:

print(sniffer.ip_address())
print(sniffer.domain_info())
print(sniffer.status_code())
# See docs for full list

Each of the methods in this package returns the corresponding detail of the website. For example, ip_address() returns the IP address of the website.

Example

from sitesniffer import SiteSniffer

sniffer = SiteSniffer('https://google.com')
print(sniffer.ip_address())

Output

'142.250.185.110'

Essential Python Libraries for Web Scraping and HTTP Requests

The following Python libraries are essential for working with the sitesniffer package:

# standard library
import re
import socket
import ssl
import time
import typing
import urllib.parse
import dataclasses

# third party
import beautifulsoup4
import idna
import requests
import python-whois

Docs

The defined functions included in SiteSniffer

Function Name Function Description
extract_protocol Extracts the protocol from the URL.
extract_hostname Extracts the hostname from the URL.
extract_path Extracts the path from the URL.
ip_address Returns the IP address of the domain.
domain_info Returns the domain information for the website.
status_code Returns the HTTP status code of the website.
ssl_info Returns the SSL certificate information for the website.
load_time Returns the website's load time.
links Returns a list of links found on the website.
is_mobile_friendly Checks if the website is mobile-friendly.
has_responsive_design Checks if the website has a responsive design.
has_cookies Checks if the website uses cookies.
has_google_analytics Checks if the website has Google Analytics installed.
page_meta_description Returns the website's meta description.
has_meta_description Checks if the website has a meta description.
page_keywords Returns the website's keywords.
has_keywords Checks if the website has keywords.

Metadata

Release files for sitesniffer 0.5.0

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

Source distribution (sdist)

Source distribution for sitesniffer 0.5.0
File Size Uploaded
sitesniffer-0.5.0.tar.gz 19.6 kB Details

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / sitesniffer-0.5.0.tar.gz

Download URL sitesniffer-0.5.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
84b71abd68e74389bc049c7f9f280c1c99106364f3189003c51ae50ebcb69f1c
BLAKE2b-256 checksum
How to use checksums
6f325b58711e1b1830a5ee8fea979251ba4c716052aa0262b01c2a51ef60149f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sitesniffer-0.5.0-py3-none-any.whl

Download URL sitesniffer-0.5.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c50f40aff34276ccd0b1ddd69ee3f261c9d499500fa141c7c7babc54fde07a8b
BLAKE2b-256 checksum
How to use checksums
f1b26fdcf3d1d118bc9363c737a0c961b480380b0af41f26889b0baa4432a160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.5.1

2 release files

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.1

2 release files

0.2

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