kjoth / tweepy-issues Goto Github PK
View Code? Open in Web Editor NEWUsing Python trying to fetch the twitter data
Using Python trying to fetch the twitter data
I'm using Python and Tweepy to fetch the Twitter followers from an account using a cursor. But I'm facing this below issue frequently, Could some one help me on how to handle this issue and Why this issue occurs.
Error
TTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: /1.1/followers/list.json?cursor=1516792635609098963&id=%40Careers (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',)))
Code
def process_follower(follower,i):
Mycode
consumer_key = ''
consumer_secret = ''''
access_token = ''**************************''
access_token_secret = ''*************''
import sys
import os
import tweepy
import time
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
get_user_to_query = 'Accountname'
f = open('Account_followers_Location04012017.json', 'w', encoding='utf-8', errors="surrogateescape")
try:
for follower in tweepy.Cursor(api.followers, id = get_user_to_query).items():
#print(follower.name)
process_follower(follower, i)
i=i+1
if i%100 == 0:
time.sleep(600)
print("sleeping")
except Exception as e:
print(e)
f.close()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.