All Projects → afunTW → ptt-web-crawler

afunTW / ptt-web-crawler

Licence: MIT License
PTT 網路版爬蟲

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ptt-web-crawler

Docs
《数据采集从入门到放弃》源码。内容简介:爬虫介绍、就业情况、爬虫工程师面试题 ;HTTP协议介绍; Requests使用 ;解析器Xpath介绍; MongoDB与MySQL; 多线程爬虫; Scrapy介绍 ;Scrapy-redis介绍; 使用docker部署; 使用nomad管理docker集群; 使用EFK查询docker日志
Stars: ✭ 118 (+490%)
Mutual labels:  crawler, scrapy
Scrapingoutsourcing
ScrapingOutsourcing专注分享爬虫代码 尽量每周更新一个
Stars: ✭ 164 (+720%)
Mutual labels:  crawler, scrapy
Qqmusicspider
基于Scrapy的QQ音乐爬虫(QQ Music Spider),爬取歌曲信息、歌词、精彩评论等,并且分享了QQ音乐中排名前6400名的内地和港台歌手的49万+的音乐语料
Stars: ✭ 120 (+500%)
Mutual labels:  crawler, scrapy
Dotnetcrawler
DotnetCrawler is a straightforward, lightweight web crawling/scrapying library for Entity Framework Core output based on dotnet core. This library designed like other strong crawler libraries like WebMagic and Scrapy but for enabling extandable your custom requirements. Medium link : https://medium.com/@mehmetozkaya/creating-custom-web-crawler-with-dotnet-core-using-entity-framework-core-ec8d23f0ca7c
Stars: ✭ 100 (+400%)
Mutual labels:  crawler, scrapy
Github Spider
Github 仓库及用户分析爬虫
Stars: ✭ 190 (+850%)
Mutual labels:  crawler, scrapy
Crawler
爬虫, http代理, 模拟登陆!
Stars: ✭ 106 (+430%)
Mutual labels:  crawler, scrapy
Python3 Spider
Python爬虫实战 - 模拟登陆各大网站 包含但不限于:滑块验证、拼多多、美团、百度、bilibili、大众点评、淘宝,如果喜欢请start ❤️
Stars: ✭ 2,129 (+10545%)
Mutual labels:  crawler, scrapy
Terpene Profile Parser For Cannabis Strains
Parser and database to index the terpene profile of different strains of Cannabis from online databases
Stars: ✭ 63 (+215%)
Mutual labels:  crawler, scrapy
auto crawler ptt beauty image
Auto Crawler Ptt Beauty Image Use Python Schedule
Stars: ✭ 35 (+75%)
Mutual labels:  crawler, ptt
Goribot
[Crawler/Scraper for Golang]🕷A lightweight distributed friendly Golang crawler framework.一个轻量的分布式友好的 Golang 爬虫框架。
Stars: ✭ 190 (+850%)
Mutual labels:  crawler, scrapy
Scrapoxy
Scrapoxy hides your scraper behind a cloud. It starts a pool of proxies to send your requests. Now, you can crawl without thinking about blacklisting!
Stars: ✭ 1,322 (+6510%)
Mutual labels:  crawler, scrapy
Filesensor
Dynamic file detection tool based on crawler 基于爬虫的动态敏感文件探测工具
Stars: ✭ 227 (+1035%)
Mutual labels:  crawler, scrapy
Taiwan News Crawlers
Scrapy-based Crawlers for news of Taiwan
Stars: ✭ 83 (+315%)
Mutual labels:  crawler, scrapy
Patentcrawler
scrapy专利爬虫(停止维护)
Stars: ✭ 114 (+470%)
Mutual labels:  crawler, scrapy
Scrapy Examples
Some scrapy and web.py exmaples
Stars: ✭ 71 (+255%)
Mutual labels:  crawler, scrapy
Crawlab Lite
Lite version of Crawlab. 轻量版 Crawlab 爬虫管理平台
Stars: ✭ 122 (+510%)
Mutual labels:  crawler, scrapy
Scrapy Azuresearch Crawler Samples
Scrapy as a Web Crawler for Azure Search Samples
Stars: ✭ 20 (+0%)
Mutual labels:  crawler, scrapy
Crawlab
Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
Stars: ✭ 8,392 (+41860%)
Mutual labels:  crawler, scrapy
Marmot
💐Marmot | Web Crawler/HTTP protocol Download Package 🐭
Stars: ✭ 186 (+830%)
Mutual labels:  crawler, scrapy
Ruiji.net
crawler framework, distributed crawler extractor
Stars: ✭ 220 (+1000%)
Mutual labels:  crawler, scrapy

ptt-web-crawler (PTT 網路版爬蟲) Build Status

Live demo

特色

  • 支援單篇及多篇文章抓取
  • 過濾資料內空白、空行及特殊字元
  • JSON 格式輸出
  • 支援 Python 2.7 - 3.4

輸出 JSON 格式

{
    "article_id": 文章 ID,
    "article_title": 文章標題 ,
    "author": 作者,
    "board": 板名,
    "content": 文章內容,
    "date": 發文時間,
    "ip": 發文位址,
    "message_conut": { # 推文
        "all": 總數,
        "boo": 噓文數,
        "count": 推文數-噓文數,
        "neutral": → 數,
        "push": 推文數
    },
    "messages": [ # 推文內容
        {
            "push_content": 推文內容,
            "push_ipdatetime": 推文時間及位址,
            "push_tag": 推/噓/→ ,
            "push_userid": 推文者 ID
        },
        ...
    ]
}

執行方式

python crawler.py -b 看板名稱 -i 起始索引 結束索引 (設為 -1 則自動計算最後一頁)
python crawler.py -b 看板名稱 -a 文章ID

範例

* 直接執行腳本:`python crawler.py -b PublicServan -i 100 200`
* 呼叫package:
    * install:`python setup.py install`
    * 直接:`python -m PttWebCrawler -b PublicServan -i 100 200`

會爬取 PublicServan 板第 100 頁 (https://www.ptt.cc/bbs/PublicServan/index100.html) 到第 200 頁 (https://www.ptt.cc/bbs/PublicServan/index200.html) 的內容,輸出至 PublicServan-100-200.json

python crawler.py -b PublicServan -a M.1413618360.A.4F0

會爬取 PublicServan 板文章 ID 為 M.1413618360.A.4F0 (https://www.ptt.cc/bbs/PublicServan/M.1413618360.A.4F0.html) 的內容,輸出至 PublicServan-M.1413618360.A.4F0.json

scrapy 範例

cd ptt_web_crawler
scrapy crawl ptt-web -a board=Gossiping -a article_id=M.1413618360.A.4F0
scrapy crawl ptt-web -a board=Gossiping -a pages=100,200
scrapy crawl ptt-web -a board=Gossiping -a pages=100,-1

測試

python test.py

ptt-web-crawler is a crawler for the web version of PTT, the largest online community in Taiwan.

usage: python crawler.py [-h] -b BOARD_NAME (-i START_INDEX END_INDEX | -a ARTICLE_ID) [-v]
optional arguments:
  -h, --help                  show this help message and exit
  -b BOARD_NAME               Board name
  -i START_INDEX END_INDEX    Start and end index
  -a ARTICLE_ID               Article ID
  -v, --version               show program's version number and exit

Output would be BOARD_NAME-START_INDEX-END_INDEX.json (or BOARD_NAME-ID.json)

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].