python URL打开输出错误

python URL打开输出错误,python,urlopen,Python,Urlopen,it输出: cj=http.cookiejar.CookieJar() opener=build_opener(HTTPCookieProcessor(cj)) data={'uid' : uid , 'password' : password } #uid is username to the website data=urllib.parse.urlencode(data) data=data.encode(encoding='utf-8') url='http://202.117.12

it输出:

cj=http.cookiejar.CookieJar()
opener=build_opener(HTTPCookieProcessor(cj))
data={'uid' : uid , 'password' : password }   #uid is username to the website
data=urllib.parse.urlencode(data)
data=data.encode(encoding='utf-8')
url='http://202.117.120.37/xdjwWebNew/Servlet/UsersControl' # url is a link to a specific page
request=Request(url,data)
response=opener.open(request)
response.geturl()
我不知道有什么问题。
任何建议都会很有帮助。

您希望它输出什么?如果要在链接处显示html页面,请使用
response.read()
。经由


预期产量是多少?你要的网址,你得到了。这有什么奇怪的?@HenryKeiter,不是这个url。它应该返回“request”中所需的url,而不是python.org。它工作正常。请求确实需要头信息吗?
'http://docs.python.org/2/library/urllib2.html?highlight=urllib'
This supports the following methods: read(), readline(), readlines()...
...these methods have the same interface as for file objects

The geturl() method returns the real URL of the page.