【发布时间】:2013-11-27 02:17:53
【问题描述】:
我正在使用 urllib2
try:
msmalvo = urllib2.urlopen(website)
except URLError as e:
msmalvo = e
if msmalvo.code == 200:
if msmalvo.read() == '<head>':
print 'Exits!'
else:
print 'Don't exist'
else:
print ' '
print msmalvo.code, ':/'
这个想法是确认在页面的源代码中找到了字符串“\head/”。 我该怎么做?
【问题讨论】: