Linux下安装Scrapy
Ubuntu 16.04 LTS
Python 2.7
Scrapy依赖环境
sudo apt-get install python-dev
sudo apt-get install libevent-dev
sudo apt-get install libssl-dev
https://doc.scrapy.org/en/1.3/intro/tutorial.html#creating-a-project
Windows下的错误
执行scrapy shell时报错
ImportError: No module named win32api
pywin32下载链接:
https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/
更改PIP源
使用豆瓣源:
pip -i https://pypi.douban.com/simple XXXX
安装virtrualenv和virtualenvwrapper-win基本使用
1.创建Python3的虚拟环境
virtualenv VIRTUALENV_NAME --python=PYTHON_PATH
example: virtualenv TEST --python=D:\Python35\python.exe
创建Python2的环境同样。
2.激活虚拟环境
Windows下:
VIRTUALENV_NAME_PATH\Scripts\activate
D:\PycharmProjects\TEST\Scripts\activate
退出虚拟环境:
VIRTUALENV_NAME_PATH\Scripts\deactivate.bat
D:\PycharmProjects\TEST\Scripts\deactivate.bat
py -2 -m pip install virtualenvwrapper-win
mkvirtualenv --python=D:\Python35\python.exe articles35
退出虚拟环境:
deactivate
no module win32api错误
pip install pypiwin32
XPath语法
Paste_Image.png Paste_Image.pngcss选择器
Paste_Image.png
网友评论