- Notifications
You must be signed in to change notification settings - Fork9
TLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS client, fingerprinting, anti-bot page bypass, and high performance.
License
thewebscraping/tls-requests
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
TLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS client, fingerprinting, anti-bot page bypass, and high performance.
To install the library, you can choose between two methods:
pip install wrapper-tls-requests
pip install git+https://github.com/thewebscraping/tls-requests.git
Start using TLS Requests with just a few lines of code:
>>>import tls_requests>>> r= tls_requests.get("https://httpbin.org/get")>>> r<Response [200 OK]>>>> r.status_code200
Basic automatically rotates:
>>>import tls_requests>>> proxy_list= [ "http://user1:pass1@proxy.example.com:8080", "http://user2:pass2@proxy.example.com:8081", "socks5://proxy.example.com:8082", "proxy.example.com:8083", # (defaults to http) "http://user:pass@proxy.example.com:8084|1.0|US", # http://user:pass@host:port|weight|region]>>> r= tls_requests.get( "https://httpbin.org/get", proxy=proxy, headers=tls_requests.HeaderRotator(), tls_identifier=tls_requests.TLSIdentifierRotator())>>> r<Response [200 OK]>>>> r.status_code200>>> tls_requests.HeaderRotator(strategy="round_robin")# strategy: Literal["round_robin", "random", "weighted"]>>> tls_requests.Proxy("http://user1:pass1@proxy.example.com:8080",weight=0.1)# default weight: 1.0
TLS Requests is a cutting-edge HTTP client for Python, offering a feature-rich,highly configurable alternative to the popularrequests library.
Built on top oftls-client,it combines ease of use with advanced functionality for secure networking.
Acknowledgment: A big thank you to all contributors for their support!
- Bypass TLS Fingerprinting: Mimic browser-like behaviors to navigate sophisticated anti-bot systems.
- Customizable TLS Client: Select specific TLS fingerprints to meet your needs.
- Ideal for Developers: Build scrapers, API clients, or other custom networking tools effortlessly.
Modern websites increasingly useTLS Fingerprinting and anti-bot tools like Cloudflare Bot Fight Mode to block web crawlers.
TLS Requests bypass these obstacles by mimicking browser-like TLS behaviors,making it easy to scrape data or interact with websites that use sophisticated anti-bot measures.
Example Code:
>>>import tls_requests>>> r= tls_requests.get('https://www.coingecko.com/')>>> r<Response [200]>
- Browser-like TLS Fingerprinting: Enables secure and reliable browser-mimicking connections.
- High-Performance Backend: Built on a Go-based HTTP backend for speed and efficiency.
- Synchronous & Asynchronous Support: Seamlessly switch between synchronous and asynchronous requests.
- Protocol Support: Fully compatible with HTTP/1.1 and HTTP/2.
- Strict Timeouts: Reliable timeout management for precise control over request durations.
- Internationalized Domain & URL Support: Handles non-ASCII URLs effortlessly.
- Cookie Management: Ensures session-based cookie persistence.
- Authentication: Native support for Basic and Function authentication.
- Content Decoding: Automatic handling of gzip and brotli-encoded responses.
- Hooks: Perfect for logging, monitoring, tracing, or pre/post-processing requests and responses.
- Unicode Support: Effortlessly process Unicode response bodies.
- File Uploads: Simplified multipart file upload support.
- Proxy Configuration: Supports Socks5, HTTP, and HTTPS proxies for enhanced privacy.
Explore the full capabilities of TLS Requests in the documentation:
- Quickstart Guide: A beginner-friendly guide.
- Advanced Topics: Learn to leverage specialized features.
- Async Support: Handle high-concurrency scenarios.
- Custom TLS Configurations:
Read the documentation:thewebscraping.github.io/tls-requests/
Found a bug? Pleaseopen an issue.
By reporting an issue you help improve the project.
Special thanks tobogdanfinn for creating the awesometls-client.
About
TLS Requests is a powerful Python library for secure HTTP requests, offering browser-like TLS client, fingerprinting, anti-bot page bypass, and high performance.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.
