urlparse
import urllib
urllib.parse.urlparse('http://www.examples.com/search/?page=1&pageSize=10')
# ParseResult(scheme='http', netloc='www.examples.com', path='/search/', params='', query='page=1&pageSize=10', fragment='')
query string: urlencode, parse_qs
urllib.parse.urlencode({'page': 1, 'pageSize': 10})
# 'page=1&pageSize=10'
urllib.parse.parse_qs('page=1&pageSize=10')
# {'page': ['1'], 'pageSize': ['10']}
urllib.parse.parse_qs('page=1&pageSize=')
# {'page': ['1']}
urllib.parse.parse_qs('page=1&pageSize=', keep_blank_values=True)
# {'page': ['1'], 'pageSize': ['']}
url quote/unquote
urllib.parse.quote('page=1&pageSize=10')
# 'page%3D1%26pageSize%3D10'
urllib.parse.unquote('page%3D1%26pageSize%3D10')
# 'page=1&pageSize=10'
urllib.parse.quote('中文.pdf')
# '%E4%B8%AD%E6%96%87.pdf'
urllib.parse.unquote('%E4%B8%AD%E6%96%87.pdf')
# '中文.pdf'