K
K
kolomiec_artiom2019-10-07 16:42:37
Python
kolomiec_artiom, 2019-10-07 16:42:37

How to parse a python site if a ConnectionError occurs?

Good afternoon! I'm trying to parse the site:

import requests
print(requests.get('https://ссылка_на_сайт'))

But an error occurs:
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

How can this be fixed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alternativshik, 2019-10-07
@alternativshik

Set the right headers and the right cookies

X
xDimus, 2019-10-07
@xDimus

Substitute some kind of User-Agent to begin with, is there no error on other sites?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question