パーソナルツール
現在の場所: ホーム takalog python の crawler 調査
書いた本
Plone 完全活用ガイド の Chapter 1, 2, 3, 11 を執筆しました。
plone のインストール、使い方から、機能・デザインのカスタマイズ、プロダクトの作り方まで、 plone のすべてがぎゅっと詰まっている書籍になっていると思います。
plone に興味がある人から、すでに使いこなしている方まで、ぜひ読んでみてください。
Plone 完全活用ガイドのサポートページ
« 2012February »
Su Mo Tu We Th Fr Sa
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
このBlogについて
鈴木たかのりです。とりあえず日記っぽく雑多なことを書き込んでいこうと思っています。 zope/plone関係の技術的な内容については http://takanory.net の方にまとめていこうと思います。 コメント・ツッコミはご自由にどうぞ。
twitter facebook linkedin foursquare
カテゴリ
android (16)
av (27)
books (35)
coreblog (49)
ds (22)
ferret (24)
google (34)
icecream (44)
lego (69)
mac (20)
misc (74)
moblog (277)
movie (32)
pc (44)
plone (337)
puzzle (42)
python (56)
server (67)
snowscoot (9)
software (126)
sports (32)
suidou (30)
winds (47)
 
文書操作

python の crawler 調査

作成者 takanori投稿日 2006年05月22日 13時21分 最終変更日時 2006年05月23日 17時37分

仕事でちょっと必要だったので、python で動く crawler(Web ページを集めまくるツール)を調べてみました。

まずは Python Cheese Shopcrawler をキーワードに検索。すると以下のものがヒットしました。

  • HarvestMan 1.4.6 final Multithreaded Offline Browser/Web Crawler
  • Orchid 1.0 Generic Multi Threaded Web Crawler
  • spider.py 0.5 Multithreaded crawling, reporting, and mirroring for Web and FTP
  • webstemmer 0.6.0 A web crawler and HTML layout analyzer
  • SpideyAgent 0.75 Each user can run their own threaded search engine and contribute to a global search database searching only the sites they want

それぞれの概要とパッと見の感想は以下のとおりです。

HarvestMan

HarvestMan is a multithreaded off-line browser.It has many features for customizing offline browsing through URL filters, depth-fetching, fetch levels, domain filters, file limits, thread limits, download depth, directory checking, and robot exclusion protocol. It is useful to download an entire Web site or certain files from a Web site to the hard disk for offline browsing later.

  • ライセンス: GPL
  • ぱっと見: crawler というよりは off-line browser というのが中心っぽい。ちょっとやりたいことに対しては冗長すぎるかも。

Orchid

Orchid is a python crawler I developed for one of my graduate courses. It is a generic multi-threaded web crawler complete with documentation. We used this crawler to locate web pages which contained malicious code. However, the logic of what to do with the crawled pages is implemented in a separate class and therefore Orchid can easily be used for any application which requires crawling the web.

  • ライセンス: 未定義
  • ぱっと見: crawler に特化して作られたらしい。よさげ。でもドキュメントが...

spider.py

This module provides multithreaded crawling, reporting, and mirroring for Web and FTP in one convenient library. Crawling depth, maximum number of URLs to crawl, and maximum number of threads are user-configurable. Reports can be generated on external URLS, internal redirects to outside URLs, unparsable HTML, non-HTTP/FTP URLs, and broken links.

  • ライセンス: BSD
  • ぱっと見: 一つのファイルで完結しているので、扱いやすそう。参考にもしやすそうで本命かも。

webstemmer

Webstemmer is a web crawler and HTML layout analyzer. It extracts articles from news sites as plain text and removes banners, ads and/or navigation links automatically. You only need to give a URL of the top page of a site and it works in an almost fully automatic way with little human intervention.

  • ライセンス: MIT
  • ぱっと見: 開発者が日本の方らしい。HTML レイアウトの解析はニュースサイトの同じ形をしたページを解析とかに使うらしい。そのあたりの機能を違う形にできたら面白いかも。

SpideyAgent

Each user can run their own threaded search engine and contribute to a global search database searching only the sites they want

  • ライセンス: BSD, GPL
  • 必須: MySQL, Turbogears
  • まっと見: 上にある spider.py を使って crawl する制御を行う部分みたい。というわけで今後の参考にはなるかも知れないけど、とりあえずは置いておく。

調査開始

というわけでよさげかな?と思われる HarvestMan, Orchid, spider.py の3つを使ってみることにしました。

結論から言うと、とりあえず spider.py で行こうかなと思っています。

あ、やろうとしているのは「特定サイトのページからリンク先をクロール」→「抽出したページから特定のデータを抜き出す」→「それをデータベースとかに保存する」ってことです。

Orchid はよさげなんですけど、最初に書いたとおりドキュメントが API のドキュメントしかなくって。実際の使い方とかが??な感じです。調べてみてもいいんですが他の選択肢を試してみてからとおもいました。

HarvestMan は結構いい感じです。外部ファイルに設定項目を書いたりできるんですけど、あれこれ項目が多すぎてちょっと何がなにやらよくわからない感じでした。 あと、個人的に致命的だったのは「クリッカブルマップ」に対応していないということ。(今回は対応していないとマズいのです) ちょっとコードをいじったら対応してくれそうでしたが、それでうまく動作しているのかちょっとわからない漢字でした。

で、最後に spider.py これは単純にクロールして URL を取得してって感じでシンプルなので、自分の方でどうとでもなりそうかなと。 簡単な使い方は test_spider.py というコードを見れば一目瞭然。とりあえずこいつを使ってみようかなと思っています。 (というか先日のプロトタイプのプロトタイプみたいなものを見せるときに使いました。)

あとは深く調べていないんですが、websteemer のページを解析する部分はいろいろ参考になるかもと思っているので、今後調べてみるかもといった感じです。

とりあえずこの仕事がどうなるかは返答待ちだったりするので、とりあえずここまで。

カテゴリ
plone plone
トラックバック用URL:
http://takanory.net/takalog/540/tbping
コメントを追加

下のフォームに記入してコメントを追加できます。平文テキスト形式。

(必須)
(必須)
(必須)
(Required)
Enter the word

Powered by vine linux, python, zope, plone, coreblog