我试图从官方文档中搜索关于SplitResult()的定义,但我找不到对我有意义的有用信息。有人能根据下面的代码给我解释一下吗?
> > > import urlparse
> > > components = urlparse.urlsplit(' http:// example.webscraping.com/ index/')
> > > print components
SplitResult( scheme =' http', netloc =' example.webscraping.com', path ='/` index/', query ='', fragment ='')
> > > print components.path
'/index.html/'发布于 2015-12-06 12:48:28
它获取一个URL,并将其分解为它的组件。更多信息请看这里:https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax
https://stackoverflow.com/questions/34114106
复制相似问题