Host name should be name of the host (hajnalgroup.com
), not url (http://hajnalgroup.com
).
>>> import socket
>>> socket.gethostbyname("http://hajnalgroup.com")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
socket.gaierror: [Errno 11004] getaddrinfo failed
>>> socket.gethostbyname("hajnalgroup.com")
'89.134.187.222'
Replace following line:
host = "http://hajnalgroup.com"
with:
host = "hajnalgroup.com"
UPDATE
All arguments to the range
function should be int
objects:
>>> range(1, 10)
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> range(1, "10")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: range() integer end argument expected, got str.
Replace conn = "100"
with conn = 100
.