Message60697
==============
program
==============
# -*- coding: gbk -*-
import httplib, urllib, urllib2#, cookielib
proxy = urllib2.ProxyHandler
({'http':'http://pic:iLusalt@proxy.pconline.com.cn:8080'})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
f = urllib2.urlopen
("http://192.168.10.177:8080/price/login.do?
method=list")
print f.read()
postdata = urllib.urlencode
({'userId':'admin', 'password':'admin'})
request = urllib2.Request
('http://192.168.10.177:8080/price/login.do?
method=login')
response = urllib2.urlopen(request, postdata)
print response.read()
====================
out put
====================
E:\jt>c:\python24\python t.py
Traceback (most recent call last):
File "t.py", line 13, in ?
response = urllib2.urlopen(request, postdata)
File "c:\python24\lib\urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "c:\python24\lib\urllib2.py", line 358, in open
response = self._open(req, data)
File "c:\python24\lib\urllib2.py", line 376, in _open
'_open', req)
File "c:\python24\lib\urllib2.py", line 337, in _call_chain
result = func(*args)
File "c:\python24\lib\urllib2.py", line 1021, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "c:\python24\lib\urllib2.py", line 996, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (10053, 'Software
caused connection abort')> |
|
Date |
User |
Action |
Args |
2008-01-20 09:57:39 | admin | link | issue1160328 messages |
2008-01-20 09:57:39 | admin | create | |
|