- mac自带python 的版本是2.7
python --version
python 2.7.16
- 安装3.7版本,设置别名为python3
brew install python3
- 安装pip到python3环境
curl https://bootstrap.pypa.io/get-pip.py | python3
- 安装xcode命令行工具
xcode-select --install
- 安装scrapy
pip install scrapy
- 安装成功
scrapy
scrapy 2.2.0 - no active project
usage:
scrapy [options] [args]
available commands:
bench run quick benchmark test
commands
fetch fetch a url using the scrapy downloader
genspider generate new spider using pre-defined templates
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 -h" to see more info about a command