我的url如下所示:
http://me:me1234#@localhost:8080/
当我在此url上运行urlparse时,它只返回me:me1234,而不是返回me:me1234.@localhost:8080
from six.moves.urllib import parse
o=parse.urlparse('http://me:me1234#@localhost:8080/')
print o
ParseResult(scheme='http',netloc='me:me1234',path='',params='',query='',fragment='@localhost:8080/'))
知道它为什么无法解析#吗?我认为这是一个相当标准的url
这是一个fragment。首先need to对其进行编码:
这应该适合你的需要
相关问题 更多 >
编程相关推荐