安裝Python的easy_install工具和BeautifulSoup模塊


1、esay_install


easy_install是Python的發行包管理工具,類似於linux的apt-get或者yum包管理工具,使用easy_install可以很方便的獲取第三方的Python發行模塊。

安裝方法:

1.1 Mac OS X 系統可以在終端執行以下命令:

curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python 
1.2 Linux系統可以執行以下命令:
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python 
1.3 Window系統:

Window系統可以直接下載ez_setup.py文件並運行


2、BeautifulSoup4


BeautifulSoup4是一個Python解析html或者xml的工具模塊,使用這個模塊做Python爬蟲也是很不錯的。

安裝方法:

2.1 Debain或Ubuntu可以通過系統軟件包管理安裝

$sudo apt-get install Python-bs4 
2.2 使用easy_install或者pip安裝:
$ sudo easy_install beautifulsoup4 
或
$ sudo pip install beautifulsoup4

另外附上BeautifulSoup4的中文文檔http://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html

還有自己寫的Python圖片爬蟲:https://github.com/qinxiandiqi/Sexyhttp://git.oschina.net/qinxiandiqi/Sexy



發佈了69 篇原創文章 · 獲贊 101 · 訪問量 63萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章