看板 Linux 關於我們 聯絡資訊
如題 用 wget 下載的網頁含有圖片 網址: https://www.mobile01.com/newsdetail/26682/eric-bike 圖片: src="//attach.mobile01.com/attach/201808/mobile01-abfe7e57cf816f7fb5fdcf08d1e98b34.jpg" 假設原始碼為 src="//image.jpg" wget 遇到這樣的連結都無動於衷, 導致下載的網頁不完整。 請問有沒有解決辦法,感激不盡! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.42.124.125 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1535725982.A.547.html
kenduest: 下載的命令完整參數是 ? 08/31 23:59
VElysian: wget -HpkKE url 09/01 00:17
VElysian: 找到 manual 中 --convert-file-only 有寫 09/01 00:19
VElysian: The rest of the URL has been left untouched, 09/01 00:20
VElysian: including the net path ("//") which would otherwise 09/01 00:20
VElysian: be processed by Wget and converted to the effective 09/01 00:20
VElysian: scheme (ie. "http://"). 09/01 00:20
VElysian: 可是下載的檔案裡還是 src="//... 啊 ><" 09/01 00:21
newversion: 試試看 -m 或 -r 09/01 00:21
VElysian: 結果還是一樣:wget -HpkKE -r -l 1 url 09/01 00:45
加入下載連結 ※ 編輯: VElysian (114.42.124.125), 09/01/2018 01:04:45
Hevak: 你要從瀏覽器的角度去思考,看到 // 瀏覽器會自動把 // 轉 09/01 01:52
Hevak: 成跟當前頁面一樣協定 09/01 01:52
Hevak: 比方說你網頁在 https://,當下頁面的 src="//開頭網址" 09/01 01:53
Hevak: 就會被當成 src="https://兩斜線後面都一樣" 處理 09/01 01:53
hijkxyzuw: 用 --convert-links 09/01 13:15