automation - Connection aborted when using Python Requests -
i attempting write script using python requests i'm running error i've never seen before , can't decipher , google doesn't seem help.
import requests email_n = 0 print ("select shoe") print (" 1 - vapormax") print (" 2 - blazer") print (" 3 - air max 90") print (" 4 - air jordan 1") print (" 5 - air presto \n") shoe = int(input("select shoe: ")) url = "123434" if (shoe == 1): url = "http://www.london.doverstreetmarket.com/nike/04.html" elif (shoe == 2): url = "http://www.london.doverstreetmarket.com/nike/05.html" elif (shoe == 3): url = "http://www.london.doverstreetmarket.com/nike/02.html" elif (shoe == 4): url = "http://www.london.doverstreetmarket.com/nike/01.html" elif (shoe == 5): url = "http://www.london.doverstreetmarket.com/nike/03.html" else: pass print (shoe) print (url) header = { 'user-agent': 'jake mills' } in range(0,2000): payload = { 'entry_2017578399':'jake leonard mills', 'entry_1814423206':' -email removed-' % (email_n), 'entry_287029075':'- number removed-', 'entry_1247748047':'nike air max 90', 'entry_798857510':'cv2 2fb', 'entry_199279768':'size 7', 'entry_1299443671':'cv2 2fb', } email_n = email_n + 1 requests.post(url, data=payload) if (i % 10 == 0): print (email_n) else: pass
this error have been receiving, have tried figure out myself i'm not having luck other assuming website refusing connection itself.
traceback (most recent call last): file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 386, in _make_request six.raise_from(e, none) file "<string>", line 2, in raise_from file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 382, in _make_request httplib_response = conn.getresponse() file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status raise remotedisconnected("remote end closed connection without" http.client.remotedisconnected: remote end closed connection without response during handling of above exception, exception occurred: traceback (most recent call last): file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/adapters.py", line 423, in send timeout=timeout file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen _stacktrace=sys.exc_info()[2]) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/util/retry.py", line 347, in increment raise six.reraise(type(error), error, _stacktrace) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/packages/six.py", line 685, in reraise raise value.with_traceback(tb) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 386, in _make_request six.raise_from(e, none) file "<string>", line 2, in raise_from file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 382, in _make_request httplib_response = conn.getresponse() file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status raise remotedisconnected("remote end closed connection without" requests.packages.urllib3.exceptions.protocolerror: ('connection aborted.', remotedisconnected('remote end closed connection without response',)) during handling of above exception, exception occurred: traceback (most recent call last): file "/users/jakemills/pycharmprojects/reebok_contest_jig/reebok_jig2.py", line 52, in <module> requests.post(url, data=payload) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/api.py", line 110, in post return request('post', url, data=data, json=json, **kwargs) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) file "/library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/requests/adapters.py", line 473, in send raise connectionerror(err, request=request) requests.exceptions.connectionerror: ('connection aborted.', remotedisconnected('remote end closed connection without response',))
is there anyway around or there no hope?
thanks guys
Comments
Post a Comment