一步一步教你在Windows下安裝Scrapy
阿新 • • 發佈:2019-01-23
http://www.tuicool.com/articles/NzAF7n
Scrapy簡介
Scrapy是一個快速,高效的網頁抓取python框架。主要用於Web抓取&提取資訊&格式化資料。經常用此做資料探勘、檢測、測試等。
安裝所需軟體
- python
- python
- python
安裝步驟
1、安裝Python 官網下載python(http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi)& 傻瓜安裝 將python路徑(D:\Python27;D:\Python27\Scripts;)加入環境變數驗證是否安裝ok
C:\Users \admin>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
2、安裝setuptools
官網下載setuptools(http://pypi.python.org/pypi/setuptools)& 傻瓜安裝
3、安裝Zope.Interface
官網下載Zope.Interface(http://pypi.python.org/pypi/zope.interface/)& 傻瓜安裝
驗證是否安裝ok C:\Users\admin>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import zope.interface
>>>
4、安裝Twisted
官網下載Twisted(http://twistedmatrix.com/trac/wiki/Downloads)& 傻瓜安裝 #進入外掛目錄並執行命令安裝
>D:\python-plugin\w3lib-1.3>python setup.py install
驗證
D:\python-plugin\w3lib-1.3>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import w3lib
>>>
6、安裝libxml2
官網下載libxml2(http://users.skynet.be/sbi/libxml-python/)& 傻瓜安裝
7、安裝pyOpenSSL
官網下載pyOpenSSL(https://pypi.python.org/pypi/pyOpenSSL)& 傻瓜安裝
8、安裝scrapy
官網下載scrapy(https://pypi.python.org/pypi/Scrapy) 安裝
#進入scrapy目錄並執行安裝
>D:\python-plugin\Scrapy-0.16.5>python setup.py install
驗證
D:\python-plugin\Scrapy-0.16.5>scrapy
Scrapy 0.16.5 - no active project
Usage:
scrapy <command> [options] [args]
Available commands:
fetch Fetch a URL using the Scrapy downloader
runspider Run a self-contained spider (without creating a project)
settings Get settings values
shell Interactive scraping console
startproject Create new project
version Print Scrapy version
view Open URL in browser, as seen by Scrapy
[ more ] More commands available when run from project directory
Use "scrapy <command> -h" to see more info about a command
D:\python-plugin\Scrapy-0.16.5>
安裝完畢 OK