git clone https://github.com/Junwu0615/Web-Crawler-Download-Img.git
pip install -r requirements.txt
python download-multi-img.py -h
#If you encounter the following problems :
ModuleNotFoundError: No module named 'python'.
ModuleNotFoundError: No module named 'pip'.
- 去檢查 C:\Users\xxx\AppData\Local\Programs\Python 是否有檔案。
- 若無,則去 Python 官網下載並安裝。
- 接著再次執行該指令;若一樣出現同樣錯誤,去
系統環境變數
當中新增2
個路徑 ( Path ) 即可 :- C:\Users\
xxx
\AppData\Local\Programs\Python\Python版本
- C:\Users\
xxx
\AppData\Local\Programs\Python\Python版本
\Scripts
- C:\Users\
-h
Help: Show this help message and exit.-t
Type: Give a type of web | ex: Unsplash / Ptt / Google Picture-u
Url : Give a url | ex: https://...-p
Path: Give a path | ex: ./img
#python download_multi_img.py -t 類型
-u 網址
-p 儲存路徑
,共 3 個輸入內容,具體請參考 STEP3. HELP
。
#當網址太長時,可以使用 PicSee 縮短網址 來幫助 命令提示字元(cmd)
讀取,以避免出錯。
在 PTT Beauty版 搜尋內容並點選進入後,其網址即為 -u
,並將圖片存放於 ./森香澄_img。
-t
PTT-u
https://www.ptt.cc/bbs/Beauty/M.1702040877.A.239.html-p
./森香澄_img
python download-multi-img.py -t ptt -u https://www.ptt.cc/bbs/Beauty/M.1702040877.A.239.html -p ./森香澄_img
在 Unsplash 以關鍵字 cat 搜尋後,其網址即為 -u
,並將圖片存放於 ./cat_img。
-t
unsplash-u
https://unsplash.com/s/photos/cat-p
./cat_img
python download-multi-img.py -t unsplash -u https://unsplash.com/s/photos/cat -p ./cat_img