taspinar / twitterscraper

Scrape Twitter for Tweets
MIT License
2.39k stars 579 forks source link

Connection Aborted Error #259

Open dev-expertise opened 4 years ago

dev-expertise commented 4 years ago

Hi, Just installed twitterscraper Tried to run the example given in READ.ME from twitterscraper import query_tweets

if name == 'main': list_of_tweets = query_tweets("Trump OR Clinton", 10)

#print the retrieved tweets to the screen:
for tweet in query_tweets("Trump OR Clinton", 10):
    print(tweet)

Is there any kind of settings that I'm missing or proxy is required to run this process. your ASAP response is highly appreciated.. exception follows

INFO: {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201'} Traceback (most recent call last): File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request self._validate_conn(conn) File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn conn.connect() File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connection.py", line 360, in connect sslcontext=context, File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/util/ssl.py", line 370, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/lib/python3.6/ssl.py", line 817, in init self.do_handshake() File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/yousuf/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 400, in increment raise six.reraise(type(error), error, _stacktrace) File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/packages/six.py", line 734, in reraise raise value.with_traceback(tb) File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request self._validate_conn(conn) File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn conn.connect() File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/connection.py", line 360, in connect sslcontext=context, File "/home/yousuf/.local/lib/python3.6/site-packages/urllib3/util/ssl.py", line 370, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/lib/python3.6/ssl.py", line 817, in init self.do_handshake() File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError(0, 'Error'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/yousuf/PycharmProjects/Twitter_User_Timeline/scrapy.py", line 1, in from twitterscraper import query_tweets File "/usr/local/lib/python3.6/dist-packages/twitterscraper/init.py", line 13, in from twitterscraper.query import query_tweets File "/usr/local/lib/python3.6/dist-packages/twitterscraper/query.py", line 73, in proxies = get_proxies() File "/usr/local/lib/python3.6/dist-packages/twitterscraper/query.py", line 43, in get_proxies response = requests.get(PROXY_URL) File "/home/yousuf/.local/lib/python3.6/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/home/yousuf/.local/lib/python3.6/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/home/yousuf/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/home/yousuf/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/home/yousuf/.local/lib/python3.6/site-packages/requests/adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', OSError(0, 'Error'))