Python:
import requests
from bs4 import BeautifulSoup
def get_instagram_profile(username):
url = f'Instagram{username}/'
response = requests.get(url)
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
script_tag = soup.find('script', text=lambda t: t and 'window._sharedData' in t).text
start = script_tag.find('{"config"')
json_data = script_tag[start:-1]
data = json.loads(json_data)
user_data = data['entry_data']['ProfilePage'][0]['graphql']['user']
profile_info = {
'username': user_data['username'],
'full_name': user_data['full_name'],
'biography': user_data['biography'],
'followers': user_data['edge_followed_by']['count'],
'following': user_data['edge_follow']['count'],
'posts': user_data['edge_owner_to_timeline_media']['count'],
'profile_pic_url': user_data['profile_pic_url_hd']
}
return profile_info
else:
return None
username = input("Instagram kullanıcı adını girin: ")
profile_info = get_instagram_profile(username)
if profile_info:
print(f"Kullanıcı Adı: {profile_info['username']}")
print(f"Tam İsim: {profile_info['full_name']}")
print(f"Biyografi: {profile_info['biography']}")
print(f"Takipçiler: {profile_info['followers']}")
print(f"Takip Edilenler: {profile_info['following']}")
print(f"Paylaşımlar: {profile_info['posts']}")
print(f"Profil Fotoğrafı URL: {profile_info['profile_pic_url']}")
else:
print("Profil bilgilerine ulaşılamadı.")
Moderatör tarafında düzenlendi:



