from yarl import URL # create a URL object url = URL('http://example.com') # Add HTTPS scheme to the url url = url.with_scheme('https') # Remove scheme from the URL url = url.without_scheme()
from yarl import URL # create a URL object url = URL('http://example.com') # Add query parameters url = url.with_query([('key1', 'value1'), ('key2', 'value2')]) # Remove query parameters url = url.with_query(None)
from yarl import URL # create a URL object url = URL('http://example.com/.././page/') # Normalize the URL url = url.with_path(url.raw_path.decode('utf-8')).normalize()
pip install yarl