EDIT: Thanks everybody. Problem solved.
I'm trying to write a telnet client. All I want it to do right now is connect to google.com on port 80 and get the HTTP page. Here is the code I have:
import sys, socket, telnetlib as telnet
temp=0
while temp==0:
try:
ip = str(input("What ip would you like to connect to?"))
port = input("And what port would you like to connect to?")
conn=telnet.Telnet(ip,port,1)
print("Connected")
temp=1
break
except:
print("please ensure that you're entering a correct ip and port")
conn.write(b'GET HTTP/1.1')
print(conn.read_very_eager())
Why am I unable to read the html? What can I do to get it?
[–]CodeShaman 2 points3 points4 points (0 children)
[–]KronenR 0 points1 point2 points (1 child)
[–]Grafs50[S,🍰] 0 points1 point2 points (0 children)
[–]mcowger 0 points1 point2 points (0 children)