I am trying to simulate a button click in Python on a website, when that button is clicked it adds some stuff to the end of the URL and returns false. If I add the stuff to the end of the URL it takes me to the right place but doesn't register that the button was click which is why I think I need to use the return false part.
Here is the exact code for the button and the button area. I don't know if this is actually doing anything or just setting up the button and waiting for the javascript to actually do the execution.
<div class="contractLink"><button type="button" value="upgrade to level 3"id="button533e24e4d7c79" class="green build" onclick="window.location.href = 'dorf1.php?a=16&c=fb5ad7'; return false;">
<div class="button-container addHoverClick">
<div class="button-background">
<div class="buttonStart">
<div class="buttonEnd">
<div class="buttonMiddle"></div>
</div>
</div>
</div>
<div class="button-content">upgrade to level 3</div>
</div>
</button>
This is where the script is that gets run when the button is clicked. I basically want to simulate the button being clicked through a python script which should go to a different URL and say "it's upgraded" (not literally say "it's upgraded" but make the website think it is and start the upgrading process)
<script type="text/javascript">
window.addEvent('domready', function()
{
if($('button533e24e4d7c79'))
{
$('button533e24e4d7c79').addEvent('click', function ()
{
window.fireEvent('buttonClicked', [this, {"type":"button","value":"upgrade to level 3","name":"","id":"button533e24e4d7c79","class":"green build","title":"","confirm":"","onclick":"window.location.href = \u0027dorf1.php?a=16\u0026amp;c=fb5ad7\u0027; return false;"}]);
});
}
});
</script>
Any help would be great, thanks for your time.