I want to parse query part from url, this is my code to do this:
>>> from urlparse import urlparse, parse_qs
>>> url = '/?param1¶m2=2'
>>> parse_qs(urlparse(url).query)
>>> {'param2': ['23']}
This code looks good, but "parse_qs" method loses query parameters like "param1" or "param1=". Can I parse query part with stantard library and save all parameters?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…