View Single Post
Old May 19th, 2006, 10:34 PM   #1
dxLo
Newbie
 
Join Date: May 2006
Posts: 1
Rep Power: 0 dxLo is on a distinguished road
Maintaining connection with URLLIB

Hello everyone, I'm a new comer... and

I am new to Python and still trying to learn its libraries.

Lately I am trying to write a program that automate the process of a browser game [php based]. Normally, a user can supply the website login page with a login name and password, plus some seeds [ not controlled by client , but viewable ]. Then it saves a cookie and continue to surf in the game in that session.

I am trying to do the same in a program. But unfortunately, I can simulate only to the fact I pass the string of login data ( and its seeds ), so basically I login for each page change/refresh and it is very inefficient. And until a stage I need to pass secondary data. I discovered it is impossible to do so without maintaining a connection.

urllib.urlopen('www.site.com', <login data + secondary data>)

Would anyone guide me to the way to maintain a connection so I do not need to connect each time?

I am using URLLIB to do the job. And if there is a good tutorial to explaining the details I would pretty appreciate it.

Thanks very much.
dxLo is offline   Reply With Quote