Skip to content

Instantly share code, notes, and snippets.

@kunpengku
Created August 22, 2017 07:32
Show Gist options
  • Save kunpengku/1bfaf63c91db31c3eb5e4a459b0997ba to your computer and use it in GitHub Desktop.
Save kunpengku/1bfaf63c91db31c3eb5e4a459b0997ba to your computer and use it in GitHub Desktop.
In [31]: url = 'http://www.baidu.com/a/b/c'
In [32]: d = dsnparse.parse(url)
In [33]: d
Out[33]: <dsnparse.ParseResult at 0x7f4a80fd99e8>
In [34]: d.path
Out[34]: '/a/b/c'
In [35]: d.host
Out[35]: 'www.baidu.com'
In [36]: d.port
In [37]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment