Hi,

I'm writing a client program that downloads data from an HTTP server via urllib, like so:

ufile = urllib.urlopen(urlstring)
text = ufile.read()
# Do stuff with text

Nice and simple. Unfortunately, the server only accepts requests with a session ID embedded inside - and I don't know how to open sessions using urllib. I've tried looking in the forums here and elsewhere online, and all I got was very generic info on cookies - nothing specific to Python, really.

Does anyone have experience doing this? Can you send me a link?

EDIT:
I found out about cookielib; I'm seeing what I can do with it now. Will let you know if I get it working. Still open to hints!

Recommended Answers

All 3 Replies

Thanks, Vegaseat. I'm reading the article now. I will post a solution if and when I get it.

Hmm. I figured it out, but the solution had little to do with Python, and more to do with the fact that one of the values I was passing in with the request wasn't in the format the servlet was expecting. :o Strange that I could make this work in Java, though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.