发布时间:2019-09-05 07:07:48编辑:auto阅读(2313)
原理:使用urlparse,先解析整个url,然后使用split('/')方式构造为词典,下面就可以直接读取
from urllib.parse import urlparse
url = 'http://www.abc.cn/jfjbmap/content/2016-01/03/node_2.htm'
urldic = urlparse(url)
print(urldic.path)
pathdict = urldic.path.split('/')
print(pathdict)
上一篇: 使用Qt Creator打造Python
下一篇: Python不识别中文解决方法
 51251
 50686
 41287
 38107
 32571
 29471
 28334
 23197
 23161
 21489
 1564°
 2284°
 1890°
 1829°
 2144°
 1876°
 2565°
 4298°
 4150°
 2959°