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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM