什么是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
谢谢!
答案 0 :(得分:1)
在 python2 中使用
from urlparse import urlparse, parse_qs
parsed_url = urlparse(url)
params = parse_qs(parsed_url.query)