This is my code:
try:
r = requests.head(url='http://'+finalURL, headers=headers, timeout=timeout, allow_redirects=True)
try:
print('Status', r.status_code)
print('Headers', r.headers)
print('Elapsed Total', r.elapsed.total_seconds())
except NameError as e:
print("Undefined variable", e)
I have tried this: print(r.raw._original_response.peer)
as I saw on another answer on here, but it doesn't work.
Another option is stream=True
but in this case Timeout
won't work, thats what I read somewhere.
How can I catch the IP and Port?