[Tutor] urlparse question

Blake Winton bwinton@latte.ca
Mon, 26 Aug 2002 15:20:21 -0400


* Danny Yoo <dyoo@hkn.eecs.berkeley.edu> [020826 14:05]:
###
>>> query_string =
"hl=en&lr=&ie=UTF-8&oe=utf-8&q=south+africa+travel+cape+town"
>>> import cgi
>>> dict = cgi.parse_qs(query_string)
>>> dict
{'hl': ['en'], 'ie': ['UTF-8'], 'oe': ['utf-8'],
 'q': ['south africa travel cape town']}
###

You might want to notice that it's completely lost the "lr=" part
of the query string.  If that's important to you, you may need to
reinvent the wheel.

Later,
Blake.
-- 
9:40pm up 52 days, 21:07, 2 users, load average: 0.02, 0.09, 0.07