tessl install tessl/pypi-w3lib@2.3.0Library of web-related functions for HTML manipulation, HTTP processing, URL handling, and encoding detection
Agent Success
Agent success rate when using this tile
84%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.91x
Baseline
Agent success rate without this tile
92%
A Python module that provides URL sanitization functionality to ensure URLs are safe and properly formatted for use in web applications.
http://example.com/path with spaces/file.html, returns a properly encoded URL @testhttp://münchen.de/page, handles the internationalized domain name correctly @testhttp://example.com/search?q=hello%20world&name=test, normalizes the encoding @test123 or not-a-url, returns None @testThe module should provide a function that takes a URL string as input and returns a sanitized, safe version of the URL. The function should:
@generates
def sanitize_url(url: str) -> str | None:
"""
Sanitizes a URL to ensure it is safe and properly formatted.
Args:
url: The URL string to sanitize
Returns:
A sanitized URL string, or None if the input is invalid
"""
passProvides URL manipulation and validation utilities.