urllib.parse Python2.7 equivalent



Python2.7 相当于什么

from urllib.parse import urlparse, parse_qs
parsed_url = urlparse(url)
params = parse_qs(parsed_url.query)

我得到

>>> from urllib.parse import urlparse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named parse

谢谢!

python2中使用

from urlparse import urlparse, parse_qs
parsed_url = urlparse(url)
params = parse_qs(parsed_url.query)

相关内容

  • 没有找到相关文章

最新更新