当前位置:网站首页>爬虫基础一
爬虫基础一
2022-07-25 10:27:00 【fatfatmomo】
APP一般会自己加密,HTTPS(http+SSL加密),爬虫爬取注意。
客户端发送request给服务器,服务器返回response
REQUEST部分的HTTP HEADER

charset:解码方式,防止乱码
Encoding:有的趴下来是的压缩包
User-Agent:告诉服务器我是什么客户端,伪装成浏览器防止反爬
Cookie:登录用,还有其他作用。
login 返回setcookie,
因为http是无状态连接,client向服务器发送http请求,第一次login,第二次再发,服务器仍然不知道client是谁。
其实在第一次login后,服务器的response返回setcookie,相当于服务端给client分配了一个id号做标识。client之后每次发送时都把cookie加上。
RESPONSE的HTTP HEADER
Location:指明跳转链接
Set-cookie:Userid
statuscode:响应状态码 :2xx-成功,3xx-跳转,4xx-客户端错误,500-服务器错误.
300-多个可用资源,可处理或丢弃;
301-重定向;
302-重定向;
304-请求的资源未更新,丢弃。
python库,如urllib2已对重定向作了自动跳转,自动再发送location的request返回给代码。

边栏推荐
- AI系统前沿动态第43期:OneFlow v0.8.0正式发布;GPU发现人脑连接;AI博士生在线众筹研究主题
- [flask advanced] deeply understand the application context and request context of flask from the source code
- Code representation learning: introduction to codebert and other related models
- [flask advanced] solve the classic error reporting of flask by combining the source code: working outside of application context
- How to optimize the performance when the interface traffic increases suddenly?
- Openstack Skyline 组件安装
- Visual thematic map of American airport go style: ArcGIS Pro version
- Reinforcement Learning 强化学习(四)
- MySQL advanced statement (I) (there is always someone who will make your life no longer bad)
- Esp32c3 based on the example tutorial of esp32 Rainmaker development under Arduino framework
猜你喜欢

Ue4.26 source code version black screen problem of client operation when learning Wan independent server

性能测试中TPS的计算【杭州多测师】【杭州多测师_王sir】

HCIA experiment (08)

Flask framework - session and cookies

机智云物联网平台 STM32 ESP8266-01S 简单无线控灯

I, AI doctoral student, online crowdfunding research topic

C# Newtonsoft.Json 高级用法

Flask框架——消息闪现

学习路之PHP--Phpstudy 提示 Mysqld.Exe: Error While Setting Value ‘NO_ENGINE_SUBSTITUTION 错误的解决办法
Learning Weekly - total issue 63 - an open source local code snippet management tool
随机推荐
Druid 查询超时配置的探究 → DataSource 和 JdbcTemplate 的 queryTimeout 到底谁生效?
UE4.26源码版学习广域网独立服务器时遇到的客户端运行黑屏问题
Hcip experiment (02)
Learn NLP with Transformer (Chapter 3)
Flask框架——flask-caching缓存
API supplement of JDBC
I, AI doctoral student, online crowdfunding research topic
BeautifulSoup的一些用法
Electromagnetic field and electromagnetic wave experiment I familiar with the application of MATLAB software in the field of electromagnetic field
【域泛化】2022 IJCAI领域泛化教程报告
Learn NLP with Transformer (Chapter 3)
Learn NLP with Transformer (Chapter 4)
机智云物联网平台 STM32 ESP8266-01S 简单无线控灯
[information system project manager] thought map series essence summary
Learn NLP with Transformer (Chapter 6)
MySQL master-slave replication and read-write separation
Openstack Skyline 组件安装
[flask advanced] deeply understand the application context and request context of flask from the source code
HCIP(11)
Signal integrity (SI) power integrity (PI) learning notes (XXXIII) 102 general design rules to minimize signal integrity problems