#2015.10.29 s='''http://baidu.com http://qq.com'''#抓取地址head="http:"tail=".com"posh=0post=0for i in range(0,s.count(head)): posh=s.find(head,post) post=s.find(tail,posh) print posh,post,s[posh:post+len(tail)]