python 2.7 的Scrapy安装介绍

一、 Scrapy简介

Scrapy is a fast high-level screen scraping and web crawling framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing.

官方主页: http://www.scrapy.org/

二、 安装Python2.7

官方主页:http://www.python.org/

下载地址:http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi

1) 安装python

安装目录:D:\Python27

2) 添加环境变量

略System Properties -> Advanced -> Environment Variables - >System Variables -> Path -> Edit

3) 验证环境变量

T:\>set Path
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Rational\common;D:\Rational\ClearCase\bin;D:\Python27;D:\Python27\Scripts
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

4) 验证Python

T:\>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

T:\>

三、 安装Twisted

Twisted is an event-driven networking engine written in Python and licensed under the open source

1) 安装setuptools

Download, build, install, upgrade, and uninstall Python packages -- easily!

官方主页:http://pypi.python.org/pypi/setuptools

下载地址:http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe

安装过程:略

2) 安装Zope.Interface

官方主页:http://pypi.python.org/pypi/zope.interface/

下载地址:http://pypi.python.org/packages/2.7/z/zope.interface/zope.interface-4.0.1-py2.7-win32.egg

安装过程:

T:\>d:
D:\>cd D:\Python27\Scripts
D:\Python27\Scripts>easy_install.exe zope.interface-4.0.1-py2.7-win32.egg
Processing zope.interface-4.0.1-py2.7-win32.egg
creating d:\python27\lib\site-packages\zope.interface-4.0.1-py2.7-win32.egg
Extracting zope.interface-4.0.1-py2.7-win32.egg to d:\python27\lib\site-packages
Adding zope.interface 4.0.1 to easy-install.pth file

Installed d:\python27\lib\site-packages\zope.interface-4.0.1-py2.7-win32.egg
Processing dependencies for zope.interface==4.0.1
Finished processing dependencies for zope.interface==4.0.1

D:\Python27\Scripts>

验证安装:

D:\Python27\Scripts>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import zope.interface
>>>

3) 安装Twisted

官方主页:http://twistedmatrix.com/trac/wiki/TwistedProject

下载地址:http://pypi.python.org/packages/2.7/T/Twisted/Twisted-12.1.0.win32-py2.7.msi

安装过程:略

四、 安装w3lib

官方主页:http://pypi.python.org/pypi/w3lib

下载地址: http://pypi.python.org/packages/source/w/w3lib/w3lib-1.2.tar.gz

解压过程:略

安装过程:

T:\w3lib-1.2>python setup.py install
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\w3lib
copying w3lib\encoding.py -> build\lib\w3lib
copying w3lib\form.py -> build\lib\w3lib
copying w3lib\html.py -> build\lib\w3lib
copying w3lib\http.py -> build\lib\w3lib
copying w3lib\url.py -> build\lib\w3lib
copying w3lib\util.py -> build\lib\w3lib
copying w3lib\__init__.py -> build\lib\w3lib
running install_lib
creating D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\encoding.py -> D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\form.py -> D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\html.py -> D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\http.py -> D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\url.py -> D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\util.py -> D:\Python27\Lib\site-packages\w3lib
copying build\lib\w3lib\__init__.py -> D:\Python27\Lib\site-packages\w3lib
byte-compiling D:\Python27\Lib\site-packages\w3lib\encoding.py to encoding.pyc
byte-compiling D:\Python27\Lib\site-packages\w3lib\form.py to form.pyc
byte-compiling D:\Python27\Lib\site-packages\w3lib\html.py to html.pyc
byte-compiling D:\Python27\Lib\site-packages\w3lib\http.py to http.pyc
byte-compiling D:\Python27\Lib\site-packages\w3lib\url.py to url.pyc
byte-compiling D:\Python27\Lib\site-packages\w3lib\util.py to util.pyc
byte-compiling D:\Python27\Lib\site-packages\w3lib\__init__.py to __init__.pyc
running install_egg_info
Writing D:\Python27\Lib\site-packages\w3lib-1.2-py2.7.egg-info

T:\w3lib-1.2>

验证安装:

T:\>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import w3lib
>>> 

五、 安装libxml2

官方主页:http://users.skynet.be/sbi/libxml-python/http://pypi.python.org/pypi/pyOpenSSL

下载地址:http://users.skynet.be/sbi/libxml-python/binaries/libxml2-python-2.7.7.win32-py2.7.exe

安装过程:略

验证安装:

T:\>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import libxml2
>>> 

六、 安装pyOpenSSL

官方主页:http://pypi.python.org/pypi/pyOpenSSL

下载地址:http://pypi.python.org/packages/2.7/p/pyOpenSSL/pyOpenSSL-0.13.winxp32-py2.7.msi

安装过程:略

验证安装:

T:\>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
>>>

七、 安装Scrapy

官方主页:http://scrapy.org/

下载地址:http://pypi.python.org/packages/source/S/Scrapy/Scrapy-0.14.4.tar.gz

解压过程:略

安装过程:

T:\Scrapy-0.14.4>python setup.py install

……
Installing easy_install-2.7-script.py script to D:\Python27\Scripts
Installing easy_install-2.7.exe script to D:\Python27\Scripts
Installing easy_install-2.7.exe.manifest script to D:\Python27\Scripts

Using d:\python27\lib\site-packages
Finished processing dependencies for Scrapy==0.14.4

T:\Scrapy-0.14.4>

验证安装:

T:\>scrapy
Scrapy 0.14.4 - 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

Use "scrapy <command> -h" to see more info about a command

T:\>

原文地址:https://www.cnblogs.com/caidapeng/p/8266947.html

时间: 2024-10-08 02:36:25

python 2.7 的Scrapy安装介绍的相关文章

(转)Scrapy安装介绍 windows环境下---

一. Scrapy简介 Scrapy is a fast high-level screen scraping and web crawling framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing

Scrapy安装介绍

一. Scrapy简介 Scrapy is a fast high-level screen scraping and web crawling framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing

Scrapy安装的那些事

收录待用,修改转载已取得腾讯云授权 Scrapy安装介绍 Scrapy的安装有多种方式,它支持Python2.7版本及以上或Python3.3版本及以上.下面说明Python3环境下的安装过程. Scrapy依赖的库比较多,至少需要依赖库有Twisted 14.0,lxml 3.4,pyOpenSSL 0.14.而在不同平台环境又各不相同,所以在安装之前最好确保把一些基本库安装好,尤其是Windows. 腾讯云有Windows.Linux多个版本系统,在这里分别介绍. 各平台安装简介 Anaco

scrapy 安装问题解决方法

1)在python3.6上 使用python -m pip install scrapy 安装时,出现如下错误: Microsoft Visual C++ 14.0 is required 2)根据搜索,先需要下载twisted 包,安装成功后,再安装scrapy 安装Twisted包来进一步安装Scrapy. 1.首先打开https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted,找到对应版本的Twisted并下载到你的文件夹.此例为Twisted?

Windows10 python 3.5 Scrapy 安装配置

学习和使用python也有2年有余,一直在cnblogs里面寻求各种问题的解决方案,还未真正的记录下自己学习.思索的点点滴滴:从今天开始将自己的学习或者实践分享出来,其目的有二:1.监督自己不断学习,不断总结:2.将自己知道的分享出来,为后来者贡献一点儿绵薄之力.言归正传,今天首记录下Scrapy的安装和配置. 正如标题所示:我目前的操作系统和python软件分别是:windows 10 和 python 3.5,所以介绍的是基于以上环境的scrapy安装. 1.安装Twisted a.首先下载

python Scrapy安装

python Scrapy安装和介绍 Windows7下安装1.执行easy_install Scrapy Centos6.5下安装 1.库文件安装yum install libxslt-devel libxml2-devel 2.将系统自带python2.6的easy_install备份,使用python2.7.10升级后的easy_install mv /usr/bin/easy_install /usr/bin/easy_install_2.6 ln -s /usr/local/pytho

Python爬虫进阶之Scrapy框架安装配置

Python爬虫进阶之Scrapy框架安装配置 初级的爬虫我们利用urllib和urllib2库以及正则表达式就可以完成了,不过还有更加强大的工具,爬虫框架Scrapy,这安装过程也是煞费苦心哪,在此整理如下. Windows 平台: 我的系统是 Win7,首先,你要有Python,我用的是2.7.7版本,Python3相仿,只是一些源文件不同. 官网文档:http://doc.scrapy.org/en/latest/intro/install.html,最权威哒,下面是我的亲身体验过程. 1

python scrapy 安装

我的系统是 Win7,首先,你要有Python,我用的是2.7.7版本,Python3相仿,只是一些源文件不同. 官网文档:http://doc.scrapy.org/en/latest/intro/install.html,最权威哒,下面是我的亲身体验过程. 1.安装Python 安装过程我就不多说啦,我的电脑中已经安装了 Python 2.7.7 版本啦,安装完之后记得配置环境变量,比如我的安装在D盘,D:\python2.7.7,就把以下两个路径添加到Path变量中 1 D:\python

芝麻HTTP:Python爬虫进阶之Scrapy框架安装配置

初级的爬虫我们利用urllib和urllib2库以及正则表达式就可以完成了,不过还有更加强大的工具,爬虫框架Scrapy,这安装过程也是煞费苦心哪,在此整理如下. Windows 平台: 我的系统是 Win7,首先,你要有Python,我用的是2.7.7版本,Python3相仿,只是一些源文件不同. 官网文档:http://doc.scrapy.org/en/latest/intro/install.html,最权威哒,下面是我的亲身体验过程. 1.安装Python 安装过程我就不多说啦,我的电