![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 1
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Lookup twill. That might be what you need. Also, pay attention to the license on any browser game - some forbid automation techniques.
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
I believe you might also need to take a look at cookielib. And if you haven't yet, there's an encoding method for urllib, to send POST data. You can find that by searching these Python forums.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|