博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Scrapy安装介绍
阅读量:6434 次
发布时间:2019-06-23

本文共 5010 字,大约阅读时间需要 16 分钟。

一、 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.

官方主页:

 

二、 安装Python2.7

官方主页:

下载地址:

 

1) 安装python

安装目录:D:\Python27

 

2) 添加环境变量

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

 

3) 验证环境变量

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

 

4) 验证Python

T:\>pythonPython 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32Type "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!

官方主页:

下载地址:

安装过程:略

 

2) 安装Zope.Interface

官方主页:

下载地址:

安装过程:

T:\>d:D:\>cd D:\Python27\ScriptsD:\Python27\Scripts>easy_install.exe zope.interface-4.0.1-py2.7-win32.eggProcessing zope.interface-4.0.1-py2.7-win32.eggcreating d:\python27\lib\site-packages\zope.interface-4.0.1-py2.7-win32.eggExtracting zope.interface-4.0.1-py2.7-win32.egg to d:\python27\lib\site-packagesAdding zope.interface 4.0.1 to easy-install.pth fileInstalled d:\python27\lib\site-packages\zope.interface-4.0.1-py2.7-win32.eggProcessing dependencies for zope.interface==4.0.1Finished processing dependencies for zope.interface==4.0.1D:\Python27\Scripts>

 

验证安装:

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

 

3) 安装Twisted

官方主页:

下载地址:

安装过程:略

 

 

四、 安装w3lib

官方主页:

下载地址:

解压过程:略

安装过程:

T:\w3lib-1.2>python setup.py installrunning installrunning buildrunning build_pycreating buildcreating build\libcreating build\lib\w3libcopying w3lib\encoding.py -> build\lib\w3libcopying w3lib\form.py -> build\lib\w3libcopying w3lib\html.py -> build\lib\w3libcopying w3lib\http.py -> build\lib\w3libcopying w3lib\url.py -> build\lib\w3libcopying w3lib\util.py -> build\lib\w3libcopying w3lib\__init__.py -> build\lib\w3librunning install_libcreating D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\encoding.py -> D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\form.py -> D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\html.py -> D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\http.py -> D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\url.py -> D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\util.py -> D:\Python27\Lib\site-packages\w3libcopying build\lib\w3lib\__init__.py -> D:\Python27\Lib\site-packages\w3libbyte-compiling D:\Python27\Lib\site-packages\w3lib\encoding.py to encoding.pycbyte-compiling D:\Python27\Lib\site-packages\w3lib\form.py to form.pycbyte-compiling D:\Python27\Lib\site-packages\w3lib\html.py to html.pycbyte-compiling D:\Python27\Lib\site-packages\w3lib\http.py to http.pycbyte-compiling D:\Python27\Lib\site-packages\w3lib\url.py to url.pycbyte-compiling D:\Python27\Lib\site-packages\w3lib\util.py to util.pycbyte-compiling D:\Python27\Lib\site-packages\w3lib\__init__.py to __init__.pycrunning install_egg_infoWriting D:\Python27\Lib\site-packages\w3lib-1.2-py2.7.egg-infoT:\w3lib-1.2>

 

验证安装:

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

 

 

五、 安装libxml2

官方主页:

下载地址:

安装过程:略

验证安装:

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

 

 

六、 安装pyOpenSSL

官方主页:

下载地址:

安装过程:略

验证安装:

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

 

 

七、 安装Scrapy

官方主页:

下载地址:

解压过程:略

安装过程:

T:\Scrapy-0.14.4>python setup.py install……Installing easy_install-2.7-script.py script to D:\Python27\ScriptsInstalling easy_install-2.7.exe script to D:\Python27\ScriptsInstalling easy_install-2.7.exe.manifest script to D:\Python27\ScriptsUsing d:\python27\lib\site-packagesFinished processing dependencies for Scrapy==0.14.4T:\Scrapy-0.14.4>

 

验证安装:

T:\>scrapyScrapy 0.14.4 - no active projectUsage:  scrapy  [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 ScrapyUse "scrapy  -h" to see more info about a commandT:\>

 

转载地址:http://dlxga.baihongyu.com/

你可能感兴趣的文章
获取AJAX加载的内容
查看>>
Git单人本地仓库操作
查看>>
orocos_kdl学习(一):坐标系变换
查看>>
两步完成利用procdump64+mimikatz获取win用户密码
查看>>
Mac 的命令行配置字体颜色
查看>>
linux后台执行程序
查看>>
剑指offer---二叉搜索树的后序遍历序列
查看>>
Bit Operation妙解算法题
查看>>
VLC Play in web
查看>>
详解PNG文件结构
查看>>
Statistics与Machine Learning有什么区别
查看>>
python 记录
查看>>
Silverlight 鼠标双击 事件
查看>>
Actionscript通过构造自定义事件和方法,谈谈可选参数的问题
查看>>
递归与尾递归总结
查看>>
笔试题错题集
查看>>
ssm+maven+pageHelper搭建maven项目实现快速分页
查看>>
UIImagePickerController, memory warning
查看>>
寻找缺失的数
查看>>
开发工程师人生之路(强烈推荐,分析的透彻!)——再次看,泪流满面!必须转型过来!...
查看>>