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.1

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.1
File Size Uploaded
sitesniffer-0.5.1.tar.gz 20.5 kB Details

Built distribution (wheel)

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

Total release size: 29.8 kB

Release files / sitesniffer-0.5.1.tar.gz

Download URL sitesniffer-0.5.1.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2d38348a0c286357ad5b85fb9e850adba86bd74239b4ab7d9074e4d3c7dae177
BLAKE2b-256 checksum
How to use checksums
0eee60cc12875c74b478773ca9b1985676b3647cbd5a2f76400a116b65427b52
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.1-py3-none-any.whl

Download URL sitesniffer-0.5.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cfa61f0040dffe6b75bb256450b7cb376cc64ef78d665b731618bfcc6cb7528
BLAKE2b-256 checksum
How to use checksums
0ad0ceb14276c219de169be4a396f5fe9c5e3450109ff554ed9297e0f26686cc
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

This release

0.5.1 This release

2 release files

0.5.0

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