A crawler picture for web PTT
- Demo Video NEW - Windows - 2017/4/23 update
- Demo Video - Linux
- Demo Video - Windows
請先確認電腦有安裝 Python 3.4.3
接著安裝套件
請先切換到該目錄底下,接著在你的命令提示字元 (cmd ) 底下輸入
pip install -r requirements.txt
基本上安裝應該沒什麼問題。
- 抓取PTT 圖檔(包含推文)
- 可指定要抓取的看板以及推文數多少以上
- 資料夾為文章標題加上推文數,資料夾內為圖片
- 方法一(指定看板抓圖)
python beauty_spider2.py [板名] [爬蟲起始的頁面] [爬幾頁] [推文多少以上]
- 方法二(指定網址抓圖)
python download_beauty.py [輸入內容.txt]
如果要從最新頁面開始爬 第一個參數請填 -1
爬蟲是利用 PTT 網頁版,所以頁面以網頁版為標準。
請參考:
https://www.ptt.cc/bbs/AKB48/index.html
- 範例一(指定看板抓圖)
python beauty_spider2.py beauty -1 3 10
爬PTT beauty板(表特板) 3頁 文章內容,然後只下載 推文數>=10 的文章內容圖片
也可以指定其他看板,如下
python beauty_spider2.py AKB48 -1 3 10
- 範例二(指定網址抓圖)
python download_beauty.py input.txt
爬 input.txt 檔案內的PTT文章連結圖片 , input.txt 檔案
- Python 3.4.3
MIT license