how to login into a website using python
<p>can someone help me to get a python work and login into these values? below</p>

<pre><code>  &lt;div class='field'&gt;
  &lt;label for='login'&gt;Login&lt;/label&gt;&lt;br/&gt;
  &lt;input id='login' name='login' size='16' type='text' /&gt;
&lt;/div&gt;
&lt;div class='field'&gt;
  &lt;label for='login_password'&gt;Password&lt;/label&gt;&lt;br/&gt;
  &lt;input id='login' name='password' size='16' type='password' /&gt;
&lt;/div&gt;
&lt;div class='field'&gt;
  &lt;input type='submit' value='Login' /&gt;
&lt;/div&gt;
</code></pre>

<p>I'm getting tired of trying million times with this code </p>

<pre><code>import sys,os,time,subprocess,threading,readline,fileinput, urllib, urllib2, cookielib
usernameInsnort = ''
passwordInsnort = ''
print 'can you pleasse insert your snort user name:'
usernameStr = raw_input(usernameInsnort)
print 'can you please insert your snort password:'
passwordStr = raw_input(passwordInsnort)
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) 
login_data = urllib.urlencode({'login' : usernameStr, 'login' : passwordStr})
opener.open('https://www.snort.org/login', login_data)
resp = opener.open ('https://www.snort.org/downloads/2142')
print resp.read()
</code></pre>

<p>thanks</p>
