 <p>Third option:</p> <pre><code>&gt;&gt;&gt; from urlparse import urlparse, parse_qs &gt;&gt;&gt; url = 'http://something.com?blah=1&amp;x=2' &gt;&gt;&gt; urlparse(url).query 'blah=1&amp;x=2' &gt;&gt;&gt; parse_qs(urlparse(url).query) {'blah': ['1'], 'x': ['2']} </code></pre>