Python web爬蟲

Python 爬蟲下程序web

# 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
 ide

相關文章
相關標籤/搜索