LoginSignup
2
5

More than 5 years have passed since last update.

Instagram-Crawlerを使ってみた

Last updated at Posted at 2019-03-24

インスタグラムで複数タグ検索ができたら便利だなぁと思い、まずはクローラーを探すところから。

下準備

chromedriverをダウンロード。

https://sites.google.com/a/chromium.org/chromedriver/
image.png
バージョンはインストールされているChromeブラウザと合わせること。
inscrawler/bin/に設置。

pip

pip install -r requirements.txt

パスワードの設定

cp inscrawler/secret.py.dist inscrawler/secret.py

secret.pyにインスタのユーザー名とパスワードを入力します。

実行

Z:\workdir\instagram-crawler>python crawler.py hashtag -t tokyo -n 10 -o ./output

DevTools listening on ws://127.0.0.1:63614/devtools/browser/436e50fa-07b0-4b55-aca3-e6af1124cf66
fetching: : 33it [00:01, 21.54it/s]
Done. Fetched 10 posts.
Z:\workdir\instagram-crawler>

hashtag モードだとkey,caption,img_url が取得できるようです

https://jsoneditoronline.org
image.png

profile はプロフが取得できるようです
image.png

なんかもっと遊びたいですねー。

Ref

https://github.com/futurice/secret
https://stackoverflow.com/questions/55201226/session-not-created-this-version-of-chromedriver-only-supports-chrome-version-7

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5