All Projects → twtrubiks → PTT_Beauty_Spider

twtrubiks / PTT_Beauty_Spider

Licence: other
PTT 表特版爬蟲圖片下載器

Projects that are alternatives of or similar to PTT Beauty Spider

PttImageSpider
PTT 圖片下載器 (抓取整個看板的圖片,並用文章標題作為資料夾的名稱 ) (使用Scrapy)
Stars: ✭ 16 (-65.96%)
Mutual labels:  spider, download, ptt
Languagepod101 Scraper
Python scraper for Language Pods such as Japanesepod101.com 👹 🗾 🍣 Compatible with Japanese, Chinese, French, German, Italian, Korean, Portuguese, Russian, Spanish and many more! ✨
Stars: ✭ 104 (+121.28%)
Mutual labels:  download, beautifulsoup
Fiction house
小说精品屋是一个多平台(web、安卓app、微信小程序)、功能完善的屏幕自适应小说漫画连载系统,包含精品小说专区、轻小说专区和漫画专区。包括小说/漫画分类、小说/漫画搜索、小说/漫画排行、完本小说/漫画、小说/漫画评分、小说/漫画在线阅读、小说/漫画书架、小说/漫画阅读记录、小说下载、小说弹幕、小说/漫画自动采集/更新/纠错、小说内容自动分享到微博、邮件自动推广、链接自动推送到百度搜索引擎等功能。
Stars: ✭ 2,710 (+5665.96%)
Mutual labels:  spider, download
Tieba-Birthday-Spider
百度贴吧生日爬虫,可抓取贴吧内吧友生日,并且在对应日期自动发送祝福
Stars: ✭ 28 (-40.43%)
Mutual labels:  spider, beautifulsoup
Bt Btt
磁力網站U3C3介紹以及域名更新
Stars: ✭ 261 (+455.32%)
Mutual labels:  spider, download
Bilili
🍻 bilibili video (including bangumi) and danmaku downloader | B站视频(含番剧)、弹幕下载器
Stars: ✭ 379 (+706.38%)
Mutual labels:  spider, download
Hive
lots of spider (很多爬虫)
Stars: ✭ 110 (+134.04%)
Mutual labels:  spider, beautifulsoup
Jssoup
JavaScript + BeautifulSoup = JSSoup
Stars: ✭ 203 (+331.91%)
Mutual labels:  spider, beautifulsoup
auto crawler ptt beauty image
Auto Crawler Ptt Beauty Image Use Python Schedule
Stars: ✭ 35 (-25.53%)
Mutual labels:  beauty, ptt
crawlerdetect
Golang module to detect bots and crawlers via the user agent
Stars: ✭ 22 (-53.19%)
Mutual labels:  spider
EFDownloader
DEPRECATED
Stars: ✭ 11 (-76.6%)
Mutual labels:  download
scraper
图片爬取下载工具,极速爬取下载 站酷https://www.zcool.com.cn/, CNU 视觉 http://www.cnu.cc/ 设计师/用户 上传的 图片/照片/插画。
Stars: ✭ 64 (+36.17%)
Mutual labels:  spider
OneDriveShareLinkPushAria2
Extract download URLs from OneDrive or SharePoint share links and push them to aria2, even on systems without a GUI.
Stars: ✭ 256 (+444.68%)
Mutual labels:  download
feaplat
爬虫管理系统,支持集群,弹性伸缩。支持运行feapder、scrapy、selenium、playwright等各种框架及脚本
Stars: ✭ 42 (-10.64%)
Mutual labels:  spider
vsco-scraper
Easily allows for scraping a VSCO
Stars: ✭ 106 (+125.53%)
Mutual labels:  download
pip-download
A wrapper for pip download in offline scenario.
Stars: ✭ 22 (-53.19%)
Mutual labels:  download
qq music downloader
用来下载qq音乐无损资源的小工具
Stars: ✭ 62 (+31.91%)
Mutual labels:  download
seenreq
Generate an object for testing if a request is sent, request is Mikeal's request.
Stars: ✭ 42 (-10.64%)
Mutual labels:  spider
s3cr3t
A supercharged S3 reverse proxy
Stars: ✭ 55 (+17.02%)
Mutual labels:  download
DSpiderDemo-Android
客户端爬虫安卓端demo
Stars: ✭ 43 (-8.51%)
Mutual labels:  spider

PTT圖片下載器 (Python) For Windows and Linux

A crawler picture for web PTT

教學

2018/12/18

refactor oop,如要看舊版,請參考 567482ba6e

請先確認電腦有安裝 Python 3.6.6

接著安裝套件

請先切換到該目錄底下,接著在你的命令提示字元 (cmd ) 底下輸入

pip install -r requirements.txt

基本上安裝應該沒什麼問題。

alt tag

特色

  • 抓取PTT 圖檔(包含推文)
  • 可指定要抓取的看板以及推文數多少以上

輸出格式

  • 資料夾為文章標題加上推文數,資料夾內為圖片

效能優化

在 python 中有 Multiprocessing 以及 Threading,兩個使用的時機用比較容易的區分分法為,

當有高 CPU ( CPU-bound ) 計算的工作時,我們使用 Multiprocessing

當有大量 I/O ( I/O-bound ) 的工作時,我們使用 Threading

使用 concurrent.futures 優化效能

本範例來說,我們大量下載圖片,是使用 Threading 才對,不過我們之前使用 Multiprocessing

當下載量大時,速度會差到兩倍 , 在這種 大量 I/O ( I/O-bound ) 的情境下 ,使用 Threading 才是對的選擇。

建議使用 python 3.5 以上,因為 max_workers 如果沒有特別指定,預設會使用 CPU*5 的 workers 數量,如下說明

concurrent.futures.ThreadPoolExecutor(max_workers=None, thread_name_prefix='')

參考連結 https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor

使用方法

  • 方法一(指定看板抓圖)
python beauty_spider2.py [板名] [爬幾頁] [推文多少以上]
  • 方法二(指定網址抓圖)
python download_beauty.py [輸入內容.txt]

爬蟲是利用 PTT 網頁版,所以頁面以網頁版為標準。

請參考:

https://www.ptt.cc/bbs/AKB48/index.html

執行範例

  • 範例一(指定看板抓圖)
python beauty_spider2.py beauty 3 10

爬 PTT beauty 板 ( 表特板 ) 3頁 文章內容,然後只下載 推文數 >= 10 的文章內容圖片

執行畫面 - 1

alt tag

輸出畫面 - 1

alt tag alt tag

也可以指定其他看板,如下

python beauty_spider2.py AKB48 3 10
  • 範例二(指定網址抓圖)
python download_beauty.py input.txt

爬 input.txt 檔案內的PTT文章連結圖片 , input.txt 檔案

alt tag

執行畫面 - 2

alt tag

輸出畫面 - 2

alt tag alt tag alt tag

執行環境

  • Python 3.6.6

Donation

如果有幫助到您,也想鼓勵我的話,歡迎請我喝一杯咖啡😆

alt tag

贊助者付款

License

MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].