How to fill a form
Sulsa
sulsa at gazeta.pl
Mon Aug 14 21:40:51 EDT 2006
I need to fill form from web site, the code for this form looks like
this:
<form action="login.php" method="post" target="_top">
<input type="text" name="username" size="25" maxlength="40"
class="post" />
<input type="password" name="password" size="25" maxlength="25"
class="post" />
<input type="hidden" name="redirect"
value="" />
<input type="submit" name="login" class="mainoption"
value="Login" />
</form>
I can of course connect to a web site and download the form, i do it
like this:
import urllib2
www = urllib2.urlopen("http://www.site.com/login.php")
form_data= stronka.read()
or using httplib:
import httplib
conn = httplib.HTTPConnection("www.site.com")
conn.request("GET", "/login.php")
data1 = conn.getresponse().read()
but i can't fill and send this form is there some simple way to do it?
More information about the Python-list
mailing list