爬虫之python scrapy副本篇

1. 环境配置

  1. [安利] vim
sudo apt-get install vim

为什么要用vim呢?因为打开vim你会看到

Help poor children in Uganda!

  1. scrapy
sudo apt-get install python-pip
sudo pip install scrapy

或者

sudo apt-get install python-scrapy
  1. BeautifulSoup
sudo pip install bs4

2. 背景知识

审查工具

F12

http

URL/URI
GET请求:
POST请求:
状态码:200 ok, 302重定向,403 forbidden,404 Not Found,500 Internal Service Error
Cookie
robots.txt
timestamp:1970.1.1到现在的秒数

html

xml
class
div
p strong
h1 h2 h3
不需要成对出现的:img br

json

json.cn

3. scrapy

迭代器

4. BeautifulSoup

soup.find()
find_all()
get_text()

5. 各种可能会遇到的问题

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容