【发布时间】:2009-01-16 15:27:24
【问题描述】:
我需要帮助我想编写一个在源代码中搜索单词的程序。
这里是一个 Python 示例:
import urllib2, re
site = "http://stackoverflow.com/"
tosearch = "Questions"
source = urllib2.urlopen(site).read()
if re.search(tosearch,source):
print "Found The Word", tosearch
【问题讨论】: