How to know what parameters to fill out for a webform using a python 3.0 script
<p>I'm going to test this on gmail just because it's a simple platform that a lot of people have and will know how to use. Please enlighten me if a) my code is wrong and b) what are the parameter inputs that are required for the webform.</p>

<p>My code is currently:</p>

<pre><code>data = {'Email':"Emailtypedhere",'Passwd':"Passwordtypedhere"} 

#note that I use 'Email' and 'Passwd' based on the name= of the username/password form fields. 
#if I should be using it based on the id= please advise. Thanks!

url = "https://accounts.google.com/ServiceLoginAuth"
data_in_string = urllib.parse.urlencode(data)
data_in_bytes = data_in_string.encode('utf-8')
urllib.request.urlopen(url,data_in_bytes)
</code></pre>

<p>From that I would assume that I am now logged into gmail. Is that correct? I got the URL from the <code>action</code> type in the form and <code>Passwd</code> from the label form password and the <code>Email</code> from the Email label form.</p>

<p>Here is the code from Gmail, specifically for the form. Please let me know if there are any parameters I am missing or if my code is valid. Thanks!</p>

<pre><code>&lt;form novalidate="" id="gaia_loginform" action="https://accounts.google.com/ServiceLoginAuth" method="post"&gt;
&lt;input type="hidden" name="continue" id="continue" value="https://mail.google.com/mail/"&gt;
&lt;input type="hidden" name="service" id="service" value="mail"&gt;
&lt;input type="hidden" name="rm" id="rm" value="false"&gt;
&lt;input type="hidden" name="dsh" id="dsh" value="-6956126811101026847"&gt;
&lt;input type="hidden" name="ltmpl" id="ltmpl" value="default"&gt;
&lt;input type="hidden" name="hl" id="hl" value="en"&gt;
&lt;input type="hidden" name="scc" id="scc" value="1"&gt;
&lt;input type="hidden" name="ss" id="ss" value="1"&gt;
&lt;input type="hidden" name="GALX" value="q83s3oZvHfE"&gt;
&lt;input type="hidden" id="pstMsg" name="pstMsg" value="1"&gt;
&lt;input type="hidden" id="dnConn" name="dnConn" value=""&gt;
&lt;input type="hidden" id="checkConnection" name="checkConnection" value="youtube:377:1"&gt;
&lt;input type="hidden" id="checkedDomains" name="checkedDomains" value="youtube"&gt;
&lt;input type="hidden" name="timeStmp" id="timeStmp" value=""&gt;
&lt;input type="hidden" name="secTok" id="secTok" value=""&gt;
&lt;div class="email-div"&gt;
&lt;label for="Email"&gt;&lt;strong class="email-label"&gt;Username&lt;/strong&gt;&lt;/label&gt;
&lt;input type="email" spellcheck="false" name="Email" id="Email" value=""&gt;
&lt;/div&gt;
&lt;div class="passwd-div"&gt;
&lt;label for="Passwd"&gt;&lt;strong class="passwd-label"&gt;Password&lt;/strong&gt;&lt;/label&gt;
&lt;input type="password" name="Passwd" id="Passwd"&gt;
&lt;/div&gt;
&lt;input type="submit" class="g-button g-button-submit" name="signIn" id="signIn" value="Sign in"&gt;
&lt;label class="remember" onclick=""&gt;
&lt;input type="checkbox" name="PersistentCookie" id="PersistentCookie" value="yes"&gt;
&lt;strong class="remember-label"&gt;
Stay signed in
&lt;/strong&gt;
&lt;/label&gt;
&lt;input type="hidden" name="rmShown" value="1"&gt;
&lt;/form&gt;
</code></pre>
