Skip to main content

This is a Python script that can extract various information about a website, including its IP address, SSL certificate information, domain information, page load time, and other useful insights.

Project description

Site Sniffer in Python 🐽

PyPi version Python 3.11 PyPi downloads Github commits 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

Alternativly:

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

Usage

Make sure that you have installed Python 3.11 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, get_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 bs4
import idna
import requests
import 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sitesniffer-0.4.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sitesniffer-0.4.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file sitesniffer-0.4.1.tar.gz.

File metadata

  • Download URL: sitesniffer-0.4.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sitesniffer-0.4.1.tar.gz
Algorithm Hash digest
SHA256 1b7e24bf7b7dd5e3f6b59fa7bafd7525e07311530228ce9eaadf07560236fd0b
MD5 e0ea60741e21105cc9cbee3119e5bb8e
BLAKE2b-256 fd3643f5bdefc4b9a68de88201d4133d4267f7e0347f2c3cf24e02ac21434a43

See more details on using hashes here.

File details

Details for the file sitesniffer-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: sitesniffer-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sitesniffer-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 133376afa0a868114a52070a0d7b9b3916c83dd033a51dae51050162f371ecb4
MD5 0a90c5721c6bcfb77f76c1bdd2a7f9c9
BLAKE2b-256 bbd6db34754d735ef1105e31391487e1f647f0b0f1ef8750c32366e3d2203b0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page