小编use*_*288的帖子

Python:Urllib.urlopen非数字端口

对于以下代码

theurl = "https://%s:%s@members.dyndns.org/nic/update?hostname=%s&myip=%s&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG" % (username, password, hostname, theip)

conn = urlopen(theurl) # send the request to the url
print(conn.read())  # read the response
conn.close()   # close the connection
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

File "c:\Python31\lib\http\client.py", line 667, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
Run Code Online (Sandbox Code Playgroud)

有任何想法吗???

python urllib urlopen

6
推荐指数
2
解决办法
8516
查看次数

标签 统计

python ×1

urllib ×1

urlopen ×1