{"id":24839,"library":"wrapper-tls-requests","title":"tls-requests","description":"A powerful and lightweight Python library for making secure and reliable HTTP/TLS fingerprint requests, version 1.2.5. It wraps tls-client to mimic browser TLS fingerprints. Releases are frequent, with multiple updates per month.","status":"active","version":"1.2.5","language":"python","source_language":"en","source_url":"https://github.com/thewebscraping/tls-requests","tags":["tls","fingerprint","http","requests","scraping","browser-mimicry"],"install":[{"cmd":"pip install wrapper-tls-requests","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Before v1.1.0, the main class was TLSSession; renamed for consistency.","wrong":"from tls_requests import TLSSession","symbol":"TLSClient","correct":"from tls_requests import TLSClient"},{"note":"","wrong":"","symbol":"TLSResponse","correct":"from tls_requests import TLSResponse"}],"quickstart":{"code":"from tls_requests import TLSClient\n\nclient = TLSClient()\nresponse = client.get('https://httpbin.org/get', headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'})\nprint(response.text)","lang":"python","description":"Initialize a TLSClient and make a GET request with a custom User-Agent to mimic a browser."},"warnings":[{"fix":"Run `pip uninstall wrapper-tls-requests && pip install wrapper-tls-requests` and update imports to `from tls_requests import ...`.","message":"The module name 'wrapper_tls_requests' is deprecated; use 'tls_requests'.","severity":"deprecated","affected_versions":"v1.2.0+"},{"fix":"Create a new TLSClient instance per thread or use threading.Lock.","message":"TLSClient is not thread-safe; sharing a client across threads may cause race conditions.","severity":"gotcha","affected_versions":"all"},{"fix":"Specify the desired fingerprint explicitly: TLSClient(tls_client_id='chrome_120') or use the 'TLSClient.from_session' method to replicate a known session.","message":"In v1.2.0, the default TLS fingerprint changed, breaking responses that depend on the old fingerprint.","severity":"breaking","affected_versions":"v1.2.0 and later"},{"fix":"Pass proxies dict to client.get(proxies={'http': 'http://proxy:8080', 'https': 'http://proxy:8080'}) or set client.proxies.","message":"HTTP proxy support requires explicit configuration; environment variables (HTTP_PROXY, HTTPS_PROXY) are not automatically honored.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install latest version and use `from tls_requests import TLSClient`. If using an older version, check documentation for correct class.","cause":"The old import path used 'wrapper_tls_requests' or the class was named 'TLSSession' in older versions.","error":"ImportError: cannot import name 'TLSClient' from 'tls_requests'"},{"fix":"Run `pip install wrapper-tls-requests` again to reinstall the binary, or manually download from https://github.com/thewebscraping/tls-client-binary.","cause":"The underlying tls-client binary is missing or corrupted.","error":"tls_requests.exceptions.TLSClientInitializationError: Failed to initialize TLS client. Ensure tls-client binary is available."},{"fix":"Replace `client.session.get(...)` with `client.get(...)`.","cause":"Incorrect usage: the client does not have a session attribute; use the client directly.","error":"AttributeError: 'TLSClient' object has no attribute 'session'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}