Skip to content

Instantly share code, notes, and snippets.

@curzona
Created January 27, 2015 05:46
Show Gist options
  • Select an option

  • Save curzona/0025180af4f8c3740549 to your computer and use it in GitHub Desktop.

Select an option

Save curzona/0025180af4f8c3740549 to your computer and use it in GitHub Desktop.
ParseResult(scheme='http', netloc='example.com', path='/over/there', params='', query='field1=value1&field2=value2&field3=value3', fragment='')
[('field1', 'value1'), ('field2', 'value2'), ('field3', 'value3')]
import urlparse
text = "http://example.com/over/there?field1=value1&field2=value2&field3=value3"
url = urlparse.urlparse(text)
print url
query = urlparse.parse_qsl(url.query)
print query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment