- # _*_ coding:utf-8 _*_
- #xiaohei.python.seo.call.me:)
- #win+python2.7.x
- import urllib2,re
- for i, line in enumerate(open('link.txt')):
- url_ = line.strip()
- print i,line
- html = urllib2.urlopen(url_).read()
- cou = html.count('360buy.com' or 'jd.com')
- if cou >= 0:
- print '有'
- else:
- print '没有'
- print "\\n\\n"
- #该片段来自于http://www.codesnippet.cn/detail/221020136555.html
来源: http://www.codesnippet.cn/detail/221020136555.html