Python 爬虫下程序
# coding:UTF-8
import urllib
#' 获取web页面内容并返回'
def getWebPageContent(url):
f = urllib.urlopen(url)
data = f.read()
f.close()
return data
url = 'http://www.baidu.com'
content = getWebPageContent(url)
print content
转载于:https://blog.51cto.com/ygongzi/828839