RSS Forums RSS
Please support our Python advertiser: Programming Forums
Views: 3564 | Replies: 3
Reply
Join Date: Jun 2005
Posts: 142
Reputation: G-Do is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 11
G-Do's Avatar
G-Do G-Do is offline Offline
Junior Poster

Opening HTTP sessions with Python

  #1  
Jul 20th, 2005
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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2004
Posts: 2,548
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 11
Solved Threads: 178
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Solution Re: Opening HTTP sessions with Python

  #2  
Jul 21st, 2005
Have you done your required reading on sockets yet?
Here is one article ...
http://www.devshed.com/c/a/Python/Sockets-in-Python/

Also look at the two websites that come up when you run
help('urllib')
May 'the Google' be with you!
Reply With Quote  
Join Date: Jun 2005
Posts: 142
Reputation: G-Do is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 11
G-Do's Avatar
G-Do G-Do is offline Offline
Junior Poster

Re: Opening HTTP sessions with Python

  #3  
Jul 21st, 2005
Thanks, Vegaseat. I'm reading the article now. I will post a solution if and when I get it.
Reply With Quote  
Join Date: Jun 2005
Posts: 142
Reputation: G-Do is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 11
G-Do's Avatar
G-Do G-Do is offline Offline
Junior Poster

Re: Opening HTTP sessions with Python

  #4  
Jul 22nd, 2005
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:04 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC