无策略的爬虫

#2015.10.29
s='''http://baidu.com http://qq.com'''#抓取地址
head="http:"
tail=".com"
posh=0
post=0
for 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)]

posted @ 2015-10-29 10:55  big_brother  阅读(132)  评论(0编辑  收藏  举报