function cambia_regione(idregione){
if (idregione==0){
idregione=document.getElementById("idregione").value;
}
else{
document.getElementById("idregione").value="";
}
document.getElementById("elencogdp").innerHTML="<img width='32' alt='' src='img/ajax-loader.gif' /><font color='red'><b>Attendere...</b></font>";
(typeof spostati_su_tag=='function')?spostati_su_tag("elenco"):alert("La pagina non \u00E8 stata caricata correttamente, Provare a ripetere le operazioni in corso ricaricando la pagina con F5.");
var url='cambiaregione.php?idregione='+idregione;
ajax(url,
function($g){
document.getElementById("elencogdp").innerHTML=$g;
spostati_su_tag("elenco");
});
}
function cambia_ufficio_reg(idufficio){
document.getElementById("esito"+idufficio).innerHTML="<img width='32' alt='' src='img/ajax-loader.gif' /><font color='red'><b>Attendere...</b></font>";
var url='cambiaufficio_salva.php?idufficio='+idufficio;
ajax(url,
function($g){
if ($g=="OK") {
if (document.getElementById("f1").nextpagina.value!="") {
document.getElementById("f1").pagina.value=document.getElementById("f1").nextpagina.value;
}
else{
document.getElementById("f1").pagina.value="intro";
}
document.getElementById("f1").submit();
}
else{
document.getElementById("esito"+idufficio).innerHTML=$g;
}
});
}
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it-IT" lang="it-IT">
<head>
<title>Ministero della Giustizia - Servizi online Giudice di Pace</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/stili6.php?browser=Chrome&browser_ver=59.0.3071.115" title="plain" />
<link rel="stylesheet" type="text/css" media="handheld" href="css/stili6_pad.php" />
<link rel="stylesheet" type="text/css" media="print" href="css/stili6_prt.php" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="js/funzioni.php?idlingua=it"></script><script type="text/javascript" src="js_cambiaufficio.php?idlingua=it"></script>
</head>
<body>
<div id="framecontent">
<div class="innertube">
SIGP@Internet 2.006 - 22.05.2017 |
<a title='lascia un suggerimento..' class="reverse" href='index.php?menu=scrivici&pagina=scrivici'>Scrivici</a>
|
<a title='autori..' class="reverse" href="index.php?menu=credits&pagina=credits">Credits</a>
</div>
</div><div id="maincontent">
<div class="innertube">
<div id='header_sito' class='header'>
<div class='logo'>
<a href='index.php?pagina=intro'>
<img style="border-style: none;" title="Homepage" alt="Homepage" src="img/LogoServiziB2.gif" />
</a>
</div>
<div class='marchio'>
<a class='button' title='Webseite in deutscher Sprache' href='index.php?idlingua=DE'> >> Deutsch</a>
<a href="javascript:CambiaFont('0.75em')" title="Caratteri piccoli"><span class="font_mini">A</span></a><a href="javascript:CambiaFont('0.965em')" title="Caratteri standard"><span class="font_piccolo">A</span></a><a href="javascript:CambiaFont('1.15em')" class="font_medio" title="Caratteri medi"><span class="font_medio">A</span></a><a href="javascript:CambiaFont('1.4em')" title="Caratteri grandi"><span class="font_grande">A</span></a>
<a href='index.php?pagina=intro'>
<img style="border-style: none" title="Homepage" alt="Homepage" src="img/marchio2.jpg" />
</a>
</div>
<hr />
</div><div id='header_ufficio_sito' class='header_ufficio'>
<div class='header_ufficio_desc'>
<p class='title6'>
<span id='ufficio_attivo'>Ufficio del Giudice di Pace di <i>-- Seleziona/Wählen Sie --</i></span>
</p>
<br />
<p class='nopadding'><a href="index.php?pagina=cambiaufficio" class="button_reverse">SCEGLI L'UFFICIO DA CONSULTARE</a></p>
</div>
<hr />
</div> <div id='corpo_sito' class='corpo'>
<script type="text/javascript">
test_getCookie();
function test_noview_menu(){(typeof noview_menu=='function')?noview_menu():alert("La pagina non \u00E8 stata caricata correttamente, Provare a ripetere le operazioni in corso ricaricando la pagina con F5.")};
function test_getCookie(){(typeof getCookie=='function')?(getCookie("font_choose")!=0)?CambiaFont(getCookie("font_choose")):null:alert("La pagina non \u00E8 stata caricata correttamente, Provare a ripetere le operazioni in corso ricaricando la pagina con F5.")};
</script>
<div id='div_menu' class='menu'>
<div class="sidebar">
<form id="fmenu" name="fmenu" action="/index.php" method="post">
<input type='hidden' name='menu' value='ricerche' />
<input type='hidden' name='pagina' value='cambiaufficio' />
<input type='hidden' name='nextpagina' value='direttarg' />
</form>
<ul>
<li class="sidebar"><a href="index.php?menu=guida&pagina=guida">Guida all'uso</a></li>
<li class="sidebar"><a href="index.php?menu=faq&pagina=faq">FAQ</a></li>
</ul>
<a name='ricorsi'></a>
<ul>
<li class="sidebar"><a title="Compilazione nota di iscrizione a ruolo e ricorso" href='#ricorsi'
>Compila il ricorso</a></li>
</ul>
<div style='display:' id='menu_ricorsi'>
<ul>
<li class="settore2"><a href='index.php?menu=ricorsi&pagina=cambiaufficio&nextpagina=ricorso_osa'>opposizione a sanzione amministrativa</a></li>
<li class="settore2"><a href='index.php?menu=ricorsi&pagina=cambiaufficio&nextpagina=ricorso_di'>decreto ingiuntivo</a></li>
</ul>
<br />
</div>
<a name='ricerche'></a>
<ul>
<li class="sidebar"><a href='#ricerche'
>Ricerche</a></li>
</ul>
<div style='display:' id='menu_ricerche'>
<ul>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=direttapiweb'>protocollo WEB</a></li>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=direttarg'>ruolo generale</a></li>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=direttasent'>sentenza</a></li>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=direttadi'>decreto ingiuntivo</a></li>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=datacitazione'>data citazione 1° udienza</a></li>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=dataiscrizione'>data iscrizione a ruolo</a></li>
<li class="settore2"><a href='index.php?menu=ricerche&pagina=cambiaufficio&nextpagina=dataudienza'>data prossima udienza</a></li>
</ul>
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
<div id='div_main' class='main'>
<div class='footer'>
SIGP@Internet 2.006 - 22.05.2017 |
<a href='index.php?menu=scrivici&pagina=scrivici'>Scrivici</a>
|
<a href="index.php?menu=credits&pagina=credits">Credits</a>
</div>
<form id="f1" name="f1" action="" method="post">
<input type='hidden' name='pagina' value='cambiaufficio' />
<input type='hidden' name='menu' value='ricerche' />
<input type='hidden' name='nextpagina' value='direttarg' />
<div class="cartina">
<p>scegli il se<!--span-->rvizio nelle regioni evidenziate</p>
<img alt="" src="img/cartaitalia_pda.jpg" width="239" height="268" border="0" align="top" usemap="#regioniMap" />
<map id="regioniMap" name="regioniMap">
<area shape="poly" coords="111,84,108,87,108,91,105,95,105,101,109,104,113,107,118,109,122,105,127,100,122,97,118,86,110,81" href="javascript:cambiaregione('10');" alt="Umbria" />
<area shape="poly" coords="120,73,132,82,135,90,138,99,129,102,122,98,120,87,112,83,111,76,120,76,122,74" href="javascript:cambiaregione('11');" alt="Marche" title="Marche" />
<area shape="poly" coords="119,15,113,14,109,14,106,16,104,22,106,24,102,28,98,30,93,35,89,33,86,38,86,43,97,52,106,51,114,53,111,48,109,44,113,38,119,37,124,36,124,34,120,33,116,32,114,28,114,25,113,23,119,14" href="javascript:cambiaregione('05');" alt="Veneto" />
<area shape="poly" coords="112,53,106,51,102,53,93,52,85,52,81,52,75,48,66,47,65,50,64,56,68,61,74,62,81,66,90,70,98,67,102,71,104,75,109,78,111,75,117,76,119,74,113,68,111,63,111,58" href="javascript:cambiaregione('08');" alt="Emilia Romagna" title="Emilia Romagna" />
<area shape="poly" coords="110,6,110,5,96,6,94,12,89,12,87,9,84,11,83,13,87,20,85,24,85,32,90,33,94,36,100,28,104,29,108,25,105,22,109,17,115,15,110,7,109,6" href="javascript:cambiaregione('04');" alt="Trentino Alto Adige" title="Trentino Alto Adige" />
<area shape="poly" coords="37,68,34,72,35,76,42,73,46,69,52,65,58,63,66,66,74,71,71,64,68,61,65,57,58,56,54,59,49,60,45,62,44,66,43,68,36,68" href="javascript:cambiaregione('07');" alt="Liguria" title="Liguria" />
<area shape="poly" coords="52,18,47,21,44,30,44,37,39,38,32,38,28,45,22,45,23,52,27,53,25,61,28,66,35,69,41,69,43,68,47,61,55,60,63,59,62,53,58,50,54,49,53,45,54,42,57,43,56,39,54,35,55,31,56,28,53,24,52,19" href="javascript:cambiaregione('01');" alt="Piemonte" title="Piemonte" />
<area shape="poly" coords="118,15,113,21,114,26,114,30,116,33,122,33,130,36,131,31,132,25,128,22,133,16,119,15" href="javascript:cambiaregione('06');" alt="Friuli Venezia Giulia" title="Friuli Venezia Giulia" />
<area shape="poly" coords="69,65,74,71,77,76,78,84,82,91,83,99,93,109,97,110,103,103,105,94,108,90,107,87,110,80,105,80,101,76,100,72,96,70,87,71,78,68,72,63,70,65" href="javascript:cambiaregione('09');" alt="Toscana" title="Toscana" />
<area shape="poly" coords="66,18,62,27,57,29,56,27,54,32,56,40,56,43,53,43,54,50,59,51,62,59,65,50,72,49,84,53,98,52,88,46,86,41,89,33,85,34,84,28,86,19,81,15,75,21,72,22,66,17,65,20" href="javascript:cambiaregione('03');" alt="Lombardia" title="Lombardia" />
<area shape="poly" coords="44,29,44,35,42,38,38,37,31,38,24,31,32,28,39,28,43,30" href="javascript:cambiaregione('02');" alt="Valle d'Aosta" title="Valle d'Aosta" />
<area shape="poly" coords="124,136,114,130,106,118,98,111,106,102,111,108,115,112,124,107,127,111,124,118,128,122,134,127,140,127,136,137,131,135,125,137" href="javascript:cambiaregione('12');" alt="Lazio" title="Lazio" />
<area shape="poly" coords="136,100,130,105,126,108,127,115,127,117,125,119,132,125,141,126,145,123,147,125,153,118,141,108,137,101" href="javascript:cambiaregione('13');" alt="Abruzzo" title="Abruzzo" />
<area shape="poly" coords="160,119,158,129,153,132,147,131,140,131,139,126,145,123,150,122,153,117,161,119" href="javascript:cambiaregione('14');" alt="Molise" title="Molise" />
<area shape="poly" coords="160,121,169,119,175,118,178,122,172,129,186,136,201,142,214,151,219,157,217,167,211,164,207,156,202,155,194,151,188,151,186,145,181,144,172,138,165,138,157,131,157,127,158,120,162,120" href="javascript:cambiaregione('16');" alt="Puglia" title="Puglia" />
<area shape="poly" coords="166,163,170,161,170,155,164,146,166,138,157,130,151,133,146,130,141,131,138,136,144,145,151,150,156,149,158,153,160,158,168,162,170,160" href="javascript:cambiaregione('15');" alt="Campania" title="Campania" />
<area shape="poly" coords="188,158,182,159,182,165,178,165,174,162,170,161,170,157,164,145,166,139,173,138,182,146,185,145,188,147,189,152,187,160" alt="Basilicata" href="javascript:cambiaregione('17');" />
<area shape="poly" coords="187,159,182,160,180,166,177,166,174,164,170,164,174,178,179,186,180,191,174,194,172,205,171,209,178,210,183,202,188,198,185,192,196,186,194,174,184,170,185,162" alt="Calabria" href="javascript:cambiaregione('18');" />
<area shape="poly" coords="170,203,162,222,167,229,162,237,153,237,146,228,139,228,123,218,116,218,115,209,129,204,138,210,169,202" alt="Sicilia" href="javascript:cambiaregione('19');" title="Sicilia" />
<area shape="poly" coords="41,137,42,144,51,141,55,137,57,136,64,140,67,150,66,154,63,169,61,184,50,188,40,182,41,170,43,156,40,150,38,146,40,138" alt="Sardegna" href="javascript:cambiaregione('20');" title="Sardegna" />
</map>
</div>
<div class="cartina">
<a name='elenco'></a><br />
<p> Oppure scegli la regione:</p>
<p>
<select size="1" id="idregione" name="idregione" onchange='javascript:cambiaregione(0);'>
<option value=""> </option><option value="13">ABRUZZO</option>
<option value="17">BASILICATA</option>
<option value="18">CALABRIA</option>
<option value="15">CAMPANIA</option>
<option value="8">EMILIA-ROMAGNA</option>
<option value="6">FRIULI-VENEZIA GIULIA</option>
<option value="12">LAZIO</option>
<option value="7">LIGURIA</option>
<option value="3">LOMBARDIA</option>
<option value="11">MARCHE</option>
<option value="14">MOLISE</option>
<option value="1">PIEMONTE</option>
<option value="16">PUGLIA</option>
<option value="20">SARDEGNA</option>
<option value="19">SICILIA</option>
<option value="9">TOSCANA</option>
<option value="4">TRENTINO-ALTO ADIGE</option>
<option value="10">UMBRIA</option>
<option value="2">VALLE D'AOSTA</option>
<option value="5">VENETO</option>
</select>
</p><br />
<span id="elencogdp"></span>
</div>
</form>
<br />
<div id='esito' align="left">
</div>
<script type="text/javascript">
function cambiaregione(c){(typeof cambia_regione=='function')?cambia_regione(c):alert("La pagina non \u00E8 stata caricata correttamente, Provare a ripetere le operazioni in corso ricaricando la pagina con F5.")}
function cambiaufficioreg(c){(typeof cambia_ufficio_reg=='function')?cambia_ufficio_reg(c):alert("La pagina non \u00E8 stata caricata correttamente, Provare a ripetere le operazioni in corso ricaricando la pagina con F5.")}
</script> <!--div id="endCorpo"></div-->
</div>
<script type="text/javascript">if(getCookie("noview_menu")==1){noview_menu2()};</script>
</div>
</div>
</div>
<div id="navtxt" class="navtext" style="position:absolute;top:-100px;left:0px;visibility:hidden"></div>
<div id="dialog-msg"></div>
</body></html>
嘿伙计们,我正在从网站上进行网络报道。我必须在栏中输入一个区域名称来触发javascrpit函数:cambia_region。在提交输入后如何使用python模拟提交表单动作来提取html? 谢谢!
答案 0 :(得分:0)
看看Selenium。你需要至少某种像PhantomJS这样的无头浏览器才能使它工作,因为JavaScript需要一个解释器