from urllib.parse import urlparse
from urllib.parse import parse_qs
from urllib.parse import urlencode
url = 'http://example.com?param1=a&token=TOKEN_TO_REPLACE¶m2=c'
o = urlparse(url)
query = parse_qs(o.query)
p = o.hostname
print(query)
python 解析url 字符串
最新推荐文章于 2023-04-19 11:00:24 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)