Pick problem out from Grabbing webpage example,help wanted

max lim at samintl.com
Thu Dec 5 20:23:55 EST 2002


Link :http://www.powersourceonline.com/pw?/LOGIN/MAIN

if you paste this link into address directly,you will see the login
page.please try it.
but i can't use the code(1) below to access the page,
code(1):
import urllib
f = urllib.urlopen(UseURL)
data = f.read()
print data

i got error message:
Operation UNSUCCESSFUL:
An error occured while performing the desired operation. Our technical
support staff will be automatically advised of this problem. Please
retry the operation later.

if i used code(2)
code(2):
import urllib,httplib,urlparse
UseURL='http://www.powersourceonline.com/pw?/LOGIN/MAIN'
(scheme, server, path, params,query,fragment) =
urlparse.urlparse(UseURL)
conn = httplib.HTTPConnection(server)
conn.request("GET", path)
r1 = conn.getresponse()
data = r1.read()
print data

i got error message:

500 Internal Server Error
The servlet named pw at the requested URL 

http://www.powersourceonline.com/pw
reported this exception: java.lang.NullPointerException. Please report
this to the administrator of the web server.

java.lang.NullPointerException at
com.mediagrif.mgn.request.MgbRequestCGIUrlEncoderBase64.decode(Compiled
Code) at com.mediagrif.mgn.servlet.MgbRequestServlet.isWebFile(Compiled
Code) at com.mediagrif.mgn.servlet.MgbRequestServlet.doGet(Compiled
Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at
javax.servlet.http.HttpServlet.service(Compiled Code) at
com.sun.server.ServletState.callService(Compiled Code) at
com.sun.server.ServletManager.callServletService(Compiled Code) at
com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at
com.sun.server.http.HttpProcessingState.execute(Compiled Code) at
com.sun.server.http.stages.Runner.process(Compiled Code) at
com.sun.server.ProcessingSupport.process(Compiled Code) at
com.sun.server.Service.process(Compiled Code) at
com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at
com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at
com.sun.server.HandlerThread.run(Compiled Code)

why i got diffient results.i hate python now :(



More information about the Python-list mailing list