あなたは間違いなくあなたがスクラップしたいすべての公開情報を提供できるInstagramのAPIをチェックアウトする必要があります。適切なAPI呼び出しを行うためのスクリプトを書くだけで済みます(下記参照)。 Instagramのウェブサイトから
:
私たちは、すべてのURLがRESTfulなこと持つために最善を尽くし。すべてのエンドポイント(URL)は、4つの異なるhttp動詞のうちの1つをサポートします。 GET要求はオブジェクトに関する情報を取得し、POST要求はオブジェクトを作成し、PUT要求はオブジェクトを更新し、最後にDELETE要求はオブジェクトを削除します。
あなたはちょうどあなたがあなたのコードでURLを使用する準備ができたら、関連するアカウントのACCESS-TOKEN値を持っている、とInstagramのは、各GETリクエストをあなたに戻ってJSONを展開できるようにする必要があります。データがでない場合は、直接を利用できますが、間接的にいつでもバックアウトすることができます。 - アカウント名 - フォロワー の数 - 人々の数は
を追ったが、ここでは偉大な出発点です: https://www.instagram.com/developer/endpoints/users/#get_users
そして、ここでは、あなたがPythonでAPIへの呼び出しになるだろう方法は次のとおりです。
#Python 2.7.6
#RestfulClient.py
import requests
from requests.auth import HTTPDigestAuth
import json
# Replace with the correct URL
url = "http://api_url"
# It is a good practice not to hardcode the credentials. So ask the user to enter credentials at runtime
myResponse = requests.get(url,auth=HTTPDigestAuth(raw_input("username: "), raw_input("Password: ")), verify=True)
#print (myResponse.status_code)
# For successful API call, response code will be 200 (OK)
if(myResponse.ok):
# Loading the response data into a dict variable
# json.loads takes in only binary or string variables so using content to fetch binary content
# Loads (Load String) takes a Json file and converts into python data structure (dict or list, depending on JSON)
jData = json.loads(myResponse.content)
print("The response contains {0} properties".format(len(jData)))
print("\n")
for key in jData:
print key + " : " + jData[key]
else:
# If response code is not ok (200), print the resulting http error code with description
myResponse.raise_for_status()
Ivはページソースを悪用することを決め、そこから必要なものすべてを取り出します。 –
アクセスは何でも最悪の選択です。 –
https://codecanyon.net/item/instagram-scrapper/20751172を試すことができます。これは、ユーザーのすべての情報を抽出し、テキストファイルにエクスポートするWindowsアプリケーションです。 –