url = ' http://images.jupiterimages.com/common/detail/27/68/22986827.jpg' url.strip().split('/')[-1])
结果
>>> url ' http://images.jupiterimages.com/common/detail/27/68/22986827.jpg' >>> url.strip() 'http://images.jupiterimages.com/common/detail/27/68/22986827.jpg' >>> url.strip().split('/') ['http:', '', 'images.jupiterimages.com', 'common', 'detail', '27', '68', '22986827.jpg'] >>> url.strip().split('/')[-1] '22986827.jpg'