关于webbrowser自动点击
我要通过webbrowser自动点击submit.总是不成功。通过IE点击话,获取的地址与form中的action不同,应该是:PDFsearchable
。请大家帮帮忙。谢谢了。
网页其中的源码:
<form action="PrintRequest" name="Print1" id="Print1" target="_blank" >
<input type="hidden" name="collection" value="journals">
<input type="hidden" name="handle" value="hein.journals/lstf30">
<input type="hidden" name="id" value="681">
<input type="hidden" name="toid" value="688">
<input type="hidden" name="div" value="68">
<input type="hidden" name="section" value="68">
<input type="hidden" name="print" value="section">
<input type="hidden" name="fromid" value="681">
<label for="format1">Format:</label>
<select name="format" id="format1"
>
<option value="PDFsearchable">PDF</option>
<option value="Text">Text</option>
</select>
<input type="submit" name="submit" value="Print/Download" onclick="change_form(document.getElementById('format1').value, 'Print1');">
</form>
<script>
window.onload =function(){
}
function change_form(in_val, form_name){
//alert(in_val);
if((in_val=='PDFsearchable')||(in_val=='PDF')){
document.forms[form_name].action=in_val;
//
}else{
document.forms[form_name].action='PrintRequest';
}
}
</script>