title: How to open a .html file and click submit button using python
body: <p>I have a <strong>.html</strong> file where I am sending a value using the submit button as follows:</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;XYZ Ltd.&lt;/TITLE&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  &lt;FORM ACTION="http://192.168.2.2/cgi-bin/http_recv.cgi" METHOD="POST"&gt;
  &lt;TEXTAREA NAME="DATA_SEND" COLS='160' ROWS='40' WRAP='none'&gt;
  
  &lt;/TEXTAREA&gt;
  &lt;INPUT TYPE="SUBMIT" VALUE="Send Data"&gt;
  &lt;/FORM&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>I did go through selenium and from my understanding it doesn't suit me. I would like to have a .html as above and maintain it, so it has to be opened and clicked. A <a href="https://stackoverflow.com/questions/13814241/cgi-form-submit-button-using-python">cgi/python</a> example did come into my notice but I would go for it only if there is no other alternative.</p>
  
  <p>How can I use python to:</p>
  
  <ol>
  <li>Open the .html file and</li>
  <li>Press the "Send Data" button</li>
  <li>Read any response given (assuming the response maybe displayed within a HTML page or a dialog box)</li>
  </ol>