
[Linux] wget 指定資料匣和wget 略過https的檢查
“ 遇到失效的https網頁,wget無法抓檔,怎麼解決? ”
此文完整連結 http://n.sfs.tw/m10712
複製連結 [Linux] wget 指定資料匣和wget 略過https的檢查@精讚(文章歡迎轉載,請尊重版權註明連結來源)
2021-02-10 16:34:45 By 張○○
wget是抓檔抓網頁的好工具,遇到HTTPS也沒問題,但是要是遇到憑證無效的HTTPS的網站,wget報錯:
# wget https://example.com/71082-20133.htm
--2021-02-10 16:25:10-- https://example.com/71082-20133.htm
Resolving example.com (example.com)... 10.10.10.10
Connecting to example.com (example.com)|10.10.10.10|:443... connected.
ERROR: The certificate of ‘example.com’ is not trusted. <== 不受信任
ERROR: The certificate of ‘example.com’ hasn't got a known issuer. <== 憑證失效原因
--2021-02-10 16:25:10-- https://example.com/71082-20133.htm
Resolving example.com (example.com)... 10.10.10.10
Connecting to example.com (example.com)|10.10.10.10|:443... connected.
ERROR: The certificate of ‘example.com’ is not trusted. <== 不受信任
ERROR: The certificate of ‘example.com’ hasn't got a known issuer. <== 憑證失效原因
這些用 https的網站難道不知道憑證要一直更新嗎?
解決失效的憑證
解決方法只要加上--no-check-certificate 即可
指定檔案放置位置
使用 -P 來指定抓到的檔案要放置的位置
-P 指定目錄
以上兩點範例,將抓到的檔案放到此目錄中的 ./jpg資料匣中, ./jpg資料匣要先建立
$ wget https://example.com/20210210.jpg -P ./jpg --no-check-certificate
[相關連結]
https://redfern.me/skipping-certificate-checks-with-wget/
你可能有興趣
HTTP的GET METHOD
使用http 的get 方法取得網頁資料
[Linux] wget 指定資料匣和wget 略過https的檢查
遇到失效的https網頁,wget無法抓檔,怎麼解決?
免費抓畫面軟體 Greenshot
明明Windows就已經有附畫面截取工具,為什麼還要推薦這個?
[PHP] 由於 scheme 不同,Cookie「_ga」在未來會被視為對XXX的跨網站 cookie
最近發現主控台出現這類的警告,很煩人…
[Mac] Forticlient 'Connection Error' '連接錯誤'
mac 筆電上的 forticlient突然不能連了,不知發生什麼事?
[PERL] 貪婪和不貪婪比對 non-greedy match
預設perl是貪婪比對,如果要取得不貪婪的比對,要怎麼做?