前回はurllib2というモジュールを使った簡単なスクレイピングの方法を紹介しました。 今日はScrapyというクローリング+スクレイピングのフレームワークを使って、 ウェブから情報を取ってくる方法をご紹介します。 フレームワークな分、以前紹介した手法よりも大掛かりなものになるので クローリング対象の大小によって、使い分けするといいでしょう。 スクレイピングとクローリングの違い クローリング: Webページをリンクを辿り情報を収集すること スクレイピング: Webページから意図した情報を抜き出す作業のこと たまに一緒の意味で使う人がいるのですが、厳密にはこのような定義です。 Scrapyとは Scrapyはクローリングとスクレイピングの両方のフレームワークです。 robots.txtやsitemapをパースしてくれたり、 クローリングの間隔を一括で定義したりできるので便利です。 インストー