Is there any library which provides similar functions as twill and mechanized but has better quality
<p>I am trying to write some test script for a web application.  So I tried use twill, which turns out to be using mechanized to parse html. But it really lets me down.  For example, somehow, it couldn't correctly recognize a form on web page requires method "POST", not "GET".</p>

<p>So, is there any better alternatives other than directly using urllib2?</p>

<hr>

<p>Edit, this this form that twill can not recognize.</p>

<pre><code>&lt;!DOCTYPE html PUBLIC '-//W3C//DTD XHTML Transitional//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv='Content-type' content='text/html; charset=utf-8' /&gt;
&lt;title&gt; Login  &lt;/title&gt;
&lt;link rel='stylesheet' href='/assets/styles/default.css' type='text/css'/&gt;
&lt;link rel='stylesheet' href='/assets/styles/button.css' type='text/css'/&gt;

&lt;link rel='stylesheet' href='/assets/styles/login.css' type='text/css'/&gt;

&lt;link rel='icon' type='image/x-icon' href='/assets/favicon.ico' /&gt; 
&lt;/head&gt;
&lt;body &gt;

&lt;div id='content_area'&gt;

&lt;div id='outter_login_area'&gt;
    &lt;div id='inner_login_area'&gt;
        &lt;div id='login_head'&gt;
            &lt;div&gt;
            Login with your
            &lt;/div&gt;
            &lt;div id='login_head_bottom'&gt;
                &lt;img src='/assets/images/header_logo.png' class='login_logo'/&gt;
                &lt;b&gt;Admin Account&lt;/b&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;hr/&gt;
        &lt;form action="." method="POST" id='user_login_form'&gt;
            &lt;div style='display:none'&gt;&lt;input type='hidden' name='csrfmiddlewaretoken' value='c6b6e0ca08d53093428c61f62f51ea1f' /&gt;&lt;/div&gt;

            &lt;div&gt;
                &lt;label for="id_username"&gt;User Name&lt;/label&gt;
                &lt;input id="id_username" type="text" name="username" maxlength="30" /&gt;

            &lt;/div&gt;
            &lt;div&gt;
                &lt;label for="id_password"&gt;Password&lt;/label&gt;
                &lt;input type="password" name="password" id="id_password" /&gt;

            &lt;/div&gt;
            &lt;div id='submit_bar'&gt;
                &lt;input name='submit_button' type="submit" value="Submit" class="button blue"/&gt;
            &lt;/div&gt;
        &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<hr>

<p>This is what twill says:</p>

<pre><code>In [5]: br.go('http://localhost:8000/')
==&gt; at http://localhost:8000/accounts/login/?next=/chancellor/

In [6]: br.get_all_forms() 
Out[6]: [&lt;_mechanize_dist.ClientForm.HTMLForm instance at 0x03112F80&gt;]

In [7]: br.get_all_forms()[0] 
Out[7]: &lt;_mechanize_dist.ClientForm.HTMLForm instance at 0x03112F80&gt;

In [8]: br.get_all_forms()[0].method 
Out[8]: 'GET'
</code></pre>
