0

I always get this error when I try the the following http code to get the link from generator.email site

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

Here is the code i tried

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'Accept-Language': 'en-US,en;q=0.9',
}
cookies = {'surl':'6jorge19753f@timjarrett.net'}
email = '6jorge19753f@timjarrett.net'
url = f'https://generator.email/{email}'
# url = 'https://generator.email/ '
print(url)
response = requests.get(url, headers=headers, cookies=cookies)
print(response.content)
quit()

How can I resolve the issue? I tried with and without headers and cookies but it isn't working.

halfer
  • 19,824
  • 17
  • 99
  • 186
sunny9495
  • 93
  • 3
  • 14

1 Answers1

1
import requests
start_url="https://generator.email/"
page_data=requests.get(start_url)
print(page_data.content)

this gave gave output properly i am not posting the output as it is very long

also

print(page_data)

output

<Response [200]>

which means that request was sent succesfully

with email id added to the start_url it gave the error

raise RemoteDisconnected("Remote end closed connection without"
                                         " response")
#many lines were there have not copied the entire thing though but this is the main problem

to view more about this error view this link Python HTTP Server/Client: Remote end closed connection without response error

joel.t.mathew
  • 114
  • 1
  • 15