インスタグラムで複数タグ検索ができたら便利だなぁと思い、まずはクローラーを探すところから。
下準備
chromedriverをダウンロード。
https://sites.google.com/a/chromium.org/chromedriver/
バージョンはインストールされている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 が取得できるようです
なんかもっと遊びたいですねー。
Ref
https://github.com/futurice/secret
https://stackoverflow.com/questions/55201226/session-not-created-this-version-of-chromedriver-only-supports-chrome-version-7