I need to parse HTML in my python script. However to get to the page I need, in my browser, to click radio button and submit form. So, how can I submit form with python and get rendered html back? Thanks, I would appreciate any help.
The form I'm talking about:
<form id="ac" method="post">
<input type="radio" id="a" name="a" value="2" onchange="document.getElementById('ac').submit();" checked="checked">
<input type="radio" id="aa" name="a" value="1" onchange="document.getElementById('ac').submit();">
<input type="radio" id="aaa" name="a" value="0" onchange="document.getElementById('ac').submit();">
</form>
You can use urllib for this: http://docs.python.org/2.7/library/urllib.html
A radio button sends its data as name=value, in this case a=2.
Modified example from Python URLLib / URLLib2 POST :