Open VarusJ opened 4 years ago
等着学呢~ 可以用twitter自带的API,我给一段代码给你你自己运行一下
import tweepy
consumer_key = 'DpFGRdAxcCWxFvekPp7FfwLxt'
consumer_secret = 'QnnyJklsVZAFesw2Prz8U76SDCCGFOL8iTcUUUkZNxPtInEfbq'
access_token = '3388759955-eftryjXcA1NfHWXyAUYuvchvGcfXgfoSEaD5zBE'
access_token_secret = 'n004TBpZXI1QOKH5HCdNZFUDIDO3c6L'
auth = tweepy.OAuthHandler (consumer_key, consumer_secret)
auth.set_access_token (access_token, access_token_secret)
#我改了一下 你自己注册啊..
api = tweepy.API(auth)
api = tweepy.API(auth, wait_on_rate_limit=True)
results=api.friends(id=user_id) #user_id就是@后面的内容,唯一识别id,可以爬到follwing和followers
等着学呢~