P = url.split('://')
If(p==https://):
g=443
elif(p==http://):
g=80
else:
Print(p)if url.lower().startswith('https://'): port = 443 else: port = 80
ftp://
port_dict = { 'http': 80, 'https': 443, 'ftp': ... , ...... } port = port_dict.get(url.split('://')[0].lower(), 80)
GET /{0} HTTP/1.0\r\nHost: {1}\r\nUser-agent: Python\r\n\r\n'