Github: https://github.com/binux/pyspider
ピーピーダー
Pythonの強力なスパイダー(Webクローラー)システム。 やってみよう!
- Pythonでスクリプトを書く
- スクリプトエディタ、タスクモニタ、プロジェクトマネージャ、結果ビューアによる強力なWebUI
- MySQL 、 MongoDB 、 Redis 、 SQLite 、 Elasticsearch ; PostgreSQLとデータベースのバックエンドとしてのSQLAlchemy
- メッセージキューとしてのRabbitMQ 、 Beanstalk 、 Redis 、 Kombu
- タスクの優先度、再試行、定期的、年齢別に再クロールなど
- 分散アーキテクチャ、クロールJavascriptのページ、Python 2. {6,7}、3. {3,4,5,6}サポートなど
チュートリアル: http : //docs.pyspider.org/ja/latest/tutorial/
ドキュメンテーション: http : //docs.pyspider.org/
リリースノート: https : //github.com/binux/pyspider/releases
サンプルコード
from pyspider.libs.base_handler import *
class Handler(BaseHandler):
crawl_config = {
}
@every(minutes=24 * 60)
def on_start(self):
self.crawl('http://scrapy.org/', callback=self.index_page)
@config(age=10 * 24 * 60 * 60)
def index_page(self, response):
for each in response.doc('a[href^="http"]').items():
self.crawl(each.attr.href, callback=self.detail_page)
def detail_page(self, response):
return {
"url": response.url,
"title": response.doc('title').text(),
}
インストール
-
pip install pyspider
- コマンド
pyspider
実行するには、 http:// localhost:5000 /
警告: WebUIはデフォルトで公開されており、システムに悪影響を与える可能性のあるコマンドを実行するために使用できます。 社内ネットワークで使用するか、webuiのneed-auth
を有効にしてください 。
クイックスタート: http : //docs.pyspider.org/ja/latest/Quickstart/
寄稿
TODO
v0.4.0
- portiaのような視覚的な掻き取りインタフェース
ライセンス
Apache License、Version 2.0でライセンス