1. 环境配置
- [安利] vim
sudo apt-get install vim
为什么要用vim呢?因为打开vim你会看到
Help poor children in Uganda!
- scrapy
sudo apt-get install python-pip
sudo pip install scrapy
或者
sudo apt-get install python-scrapy
- 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()