wget 下載網頁 src="//..." - Linux

Table of Contents

如題

用 wget 下載的網頁含有圖片

網址:
https://www.mobile01.com/newsdetail/26682/eric-bike

圖片:
src="//attach.mobile01.com/attach/201808/mobile01-abfe7e57cf816f7fb5fdcf08d1e98b34.jpg"

假設原始碼為 src="//image.jpg"

wget 遇到這樣的連結都無動於衷,

導致下載的網頁不完整。


請問有沒有解決辦法,感激不盡!

--

All Comments

Noah avatarNoah2018-09-01
下載的命令完整參數是 ?
Adele avatarAdele2018-09-06
wget -HpkKE url
Catherine avatarCatherine2018-09-07
找到 manual 中 --convert-file-only 有寫
Frederic avatarFrederic2018-09-07
The rest of the URL has been left untouched,
including the net path ("//") which would otherwise
be processed by Wget and converted to the effective
scheme (ie. "http://").
Damian avatarDamian2018-09-12
可是下載的檔案裡還是 src="//... 啊 ><"
Audriana avatarAudriana2018-09-14
試試看 -m 或 -r
Bennie avatarBennie2018-09-15
結果還是一樣:wget -HpkKE -r -l 1 url
Sierra Rose avatarSierra Rose2018-09-20
你要從瀏覽器的角度去思考,看到 // 瀏覽器會自動把 // 轉
成跟當前頁面一樣協定
Madame avatarMadame2018-09-22
比方說你網頁在 https://,當下頁面的 src="//開頭網址"
就會被當成 src="https://兩斜線後面都一樣" 處理
Eartha avatarEartha2018-09-25
用 --convert-links