Curl可以模拟浏览器

curl直接访问被拒绝

[22:10:00 root@C7 ~]#curl -I www.163.com
HTTP/1.1 403 Forbidden
Date: Wed, 24 Jun 2020 02:02:54 GMT
Content-Type: text/html
Content-Length: 1808
Connection: keep-alive
Server: Cdn Cache Server V2.0
Expires: Wed, 24 Jun 2020 02:02:54 GMT
X-Via: 1.0 PS-SJW-01P4H104:9 (Cdn Cache Server V2.0)
X-Ws-Request-Id: 5ef2b44e_PS-SJW-01P4H104_72535-4362
Cache-Control: no-cache,no-store,private

curl 使用-A选项,模拟chrome,即可获得源代码

[22:11:32 root@C7 ~]#curl -A chrome www.163.com
* * * 胖并快乐着的死肥宅 * * *
原文地址:https://www.cnblogs.com/bpzblog/p/13186141.html