我玩弄Python和这里面的,我试图用它是这样的的Python urllib2.urlopen在URL
https://[[email protected]]:[password]@domain.com/blah
这是一个URL @符号是我的代码:
response =urllib2.urlopen("https://[[email protected]]:[password]@domain.com/blah")
html = response.read()
print ("data="+html)
这没有经过,它不喜欢@符号,也可能是:也是。我尝试了搜索,并且阅读了一些关于无引号的内容,但这没有做任何事情。这是我得到的错误:
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: '[email protected]'
我该如何解决这个问题?实际的网站是“https://updates.opendns.com/nic/update?hostname=
谢谢!
好的,我会尝试 – Groovdafied
我可能会得到一个例子吗?我正在阅读文档,但它不能解决问题。 – Groovdafied
尝试在我的编辑中张贴的代码。 – deweyredman