Real Headers is a Python library that generates random HTTP headers and browser fingerprints that mimic real browsers.
Project description
Real Headers
Real Headers is a Python library that generates random HTTP headers and browser fingerprints that mimic real browsers. It is designed to be used in web scraping and automation tasks, where realistic headers are essential for avoiding detection and ensuring proper functionality.
Installation
You can install the real_headers
library using pip:
pip install real_headers
Features
- Generates random HTTP headers based on popular web browsers like Chrome, Firefox, Opera, Edge, Chromium, and Safari.
- Provides realistic random user agents.
Usage
Generating Real Headers
To generate a random set of HTTP headers that mimic real browsers:
from real_headers import real_headers
headers = real_headers()
print(headers)
Example Output:
{
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, sdch',
'Accept-Language': 'en-US,en;q=0.8',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58.0.3029.110 Chrome/58.0.3029.110 Safari/537.36'
}
Generating a Random User Agent
To get a random user agent string:
from real_headers import random_user_agent
user_agent = random_user_agent()
print(user_agent)
Example Output:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
File details
Details for the file real_headers-0.1.0.tar.gz
.
File metadata
- Download URL: real_headers-0.1.0.tar.gz
- Upload date:
- Size: 46.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b600c92a110644e845f965097fbbafb3518c4a7862f4fdb4958274baa956024 |
|
MD5 | bde3ecbf9d120a80ba5c48704715ed2a |
|
BLAKE2b-256 | 81aa953246ce495b5f1d7b06212dbda96b183e11ff212f3afb56e299d10efbc5 |
File details
Details for the file real_headers-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: real_headers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 47.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8d0995bf9c603f6fa4c24429cbe98ffb1c7f5c03ce982c103ada14173c5afa |
|
MD5 | 9375214b0b245cc6850da4e67bd7bb65 |
|
BLAKE2b-256 | 37f6283528f56bb8542b216fc13e9877b3c316377236628b77ca428c801820e3 |