récupérer le texte d'une page web

Forum dédié aux problématiques concernant les scripts pour DomoticZ.
Entourez votre code et les logs avec les balises nommées code grâce au bouton <\>.
jackslayter
Messages : 1040
Inscription : 30 sept. 2014, 14:40
Localisation : Isère (38)

récupérer le texte d'une page web

Message par jackslayter »

je voudrais récupérer les infos (texte) de cette page http://vigilance.meteofrance.com/Bullet ... 75&b=2&c=1 pour l'utiliser en script.

j'ai déjà eu besoin de ce genre de chose et j'utilisais cette commande

Code : Tout sélectionner

wget -O - -q --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" "http://vigilance.meteofrance.com/Bulletin_sans.html?a=dept75&b=2&c=1" > meteo.txt
mais dans le fichier il y a :

Code : Tout sélectionner

<!-- CADRE INFO VIGILANCE -->
                <table border="0" cellpadding="0" cellspacing="0" width="495"  height="90" >
                  <tr>
                      <td class="texte12_bull"  VALIGN="top    colspan="1" rowspan="1">
					  <script>
                      document.write("<iframe width='501' height='220' frameborder='0'  scrolling='no' src='bulletin_SIV_complet.html?a="+dept+"&b=1&c='></iframe> ");

                    if(couleur==1)document.write(" <span style='background-color: rgb(40, 215, 97);'> D&eacute;partement en vigilance verte.</span> </b><br> Pas de vigilance particuli&egrave;re. ");
                    
                    else if(couleur==2)document.write(" <span style='background-color: rgb(255, 255, 0);'> D&eacute;partement en vigilance "+ tab_baratin_plus_cote[dept]+"</b></span><br> Soyez attentif si vous pratiquez des activit&eacute;s sensibles au risque m&eacute;t&eacute;orologique ou &agrave proximit&eacute d&prime;un rivage ou d&prime;un cours d&prime;eau; des ph&eacute;nom&egrave;nes habituels dans la r&eacute;gion mais occasionnellement et localement dangereux  sont en effet pr&eacute;vus; tenez-vous au courant de 		l&rsquo;&eacute;volution de la situation.");
                    else if(couleur==3)document.write(" <span style='background-color: rgb(255, 196, 0);'> D&eacute;partement en vigilance "+ tab_baratin_orange[dept]+"</span> </b><br> ");
                    else if(couleur==4)document.write(" <span style='background-color: rgb(255, 0, 0);'> D&eacute;partement en vigilance "+ tab_baratin_rouge[dept]+"</span> </b><br> ");
					</script>
					<br><br></td></tr></table>

alors que quand j'enregistre sous windows/firefox j'ai ca

Code : Tout sélectionner

<!-- CADRE INFO VIGILANCE -->
                <table height="90" border="0" cellpadding="0" cellspacing="0" width="495">
                  <tbody><tr>
                      <td class="texte12_bull" 1"="" rowspan="1" valign="top    colspan=">
					  <script>
                      document.write("<iframe width='501' height='220' frameborder='0'  scrolling='no' src='bulletin_SIV_complet.html?a="+dept+"&b=1&c='></iframe> ");

                    if(couleur==1)document.write(" <span style='background-color: rgb(40, 215, 97);'> D&eacute;partement en vigilance verte.</span> </b><br> Pas de vigilance particuli&egrave;re. ");
                    
                    else if(couleur==2)document.write(" <span style='background-color: rgb(255, 255, 0);'> D&eacute;partement en vigilance "+ tab_baratin_plus_cote[dept]+"</b></span><br> Soyez attentif si vous pratiquez des activit&eacute;s sensibles au risque m&eacute;t&eacute;orologique ou &agrave proximit&eacute d&prime;un rivage ou d&prime;un cours d&prime;eau; des ph&eacute;nom&egrave;nes habituels dans la r&eacute;gion mais occasionnellement et localement dangereux  sont en effet pr&eacute;vus; tenez-vous au courant de 		l&rsquo;&eacute;volution de la situation.");
                    else if(couleur==3)document.write(" <span style='background-color: rgb(255, 196, 0);'> D&eacute;partement en vigilance "+ tab_baratin_orange[dept]+"</span> </b><br> ");
                    else if(couleur==4)document.write(" <span style='background-color: rgb(255, 0, 0);'> D&eacute;partement en vigilance "+ tab_baratin_rouge[dept]+"</span> </b><br> ");
					</script><iframe scrolling="no" src="Bulletin%20vigilance%20M%C3%A9t%C3%A9o%20France_fichiers/bulletin_SIV_complet.htm" frameborder="0" height="220" width="501"></iframe>  <span style="background-color: rgb(255, 255, 0);"> Département en vigilance  jaune  Orages</span><br>
 Soyez attentif si vous pratiquez des activités sensibles au risque 
météorologique ou à proximité d′un rivage ou d′un cours d′eau; des 
phénomènes habituels dans la région mais occasionnellement et localement
 dangereux  sont en effet prévus; tenez-vous au courant de 		l’évolution
 de la situation.
					<br><br></td></tr></tbody></table>
avec mes infos

Avez vous une commande wget/curl qui marche avec les infos?

Merci
Raspberry Pi + RFLink + Domoticz Beta
Oregon - 3x Thgr122Nx / Chacon - micromodule 200w, télécommande 3b et 16b, 2x module 1000w, détecteur de fumée, contact de porte, 2x prise 3500w / OWL - CM180 / TRC02 v2 RGB 3M / Cheap - PIR, contact de porte
papoo
Messages : 2029
Inscription : 10 janv. 2016, 11:29
Localisation : Limoges (87)
Contact :

Re: récupérer le texte d'une page web

Message par papoo »

tu souhaiterais recuperer le texte après la deuxième iframe c'est ça ? la où les caractères accentués ne sont pas au format html?
moi sous firefox et chrome je n'ai qu'une iframe et du texte avec les accents au format html

Code : Tout sélectionner

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bulletin vigilance M&eacute;t&eacute;o France</title>
<META NAME="Publisher" CONTENT="Mto-France" />
<META HTTP-EQUIV="Refresh" CONTENT="3640" />
<META NAME="Description" CONTENT="Carte de vigilance M&eacute;t&eacute;o-France:Information sur les risques m&eacute;t&eacute;orologiques des 24 prochaines heures,alertes meteo,  Weather forecasting  warnings" />
<META NAME="Date" CONTENT="2 OCT 15"/>
<meta name="date" content="2016-03-03" scheme="YYYY-MM-DD">
<META NAME="Keywords" CONTENT="Carte de vigilance,meteo, meteo-france,alerte,neige,orage,vagues,rafales "/>
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=.3, minimum-scale=0.3" > 
<link href="Accueilhtml_fichiers/style_page.css" rel="stylesheet" type="text/css" />
 
<style type="text/css">
<!--

			body {
				background: #4E5869;
				padding: 0;
				margin: 0;
				color: #000;
			}	
			
			.container {
				width: 100%;
				max-width: 1024px;
				min-width: 780px;
				min-height: 1024px;
				background: #FFF;
				margin: 0 auto; 
				overflow: hidden; 
			}	
			
			#innerDiv{
             	z-index: 1000;
                position: relative;
			}

-->
</style>
<!--[if lte IE 7]>
<style>
.content { margin-right: -1px; } 
ul.nav a { zoom: 1; } 
</style>
<![endif]-->			

 
 <script src="js/vigilanceFonctionsAccueil_vigi_float_lint.js" type="text/javascript"></script>
 <script src="js/meta_lint.js" type="text/javascript"></script>
 <script src="js/aff_vignette.js" type="text/javascript"></script>
 <script src="js/lire_nxfr33_lint.js" type="text/javascript"></script>
 <script src="js/prev.js" type="text/javascript"></script>
<script>
//alert(window.location)
 		hsh1 = new Date();
		alea=hsh1.getFullYear()*365*60*24 * +hsh1.getMonth()*30*12*60*24  +hsh1.getDate()*60*24  +hsh1.getHours() *60 + hsh1.getMinutes(); 
		var dept = window.location.search.substring(((window.location.search.indexOf('a=dept'))+6),((window.location.search.indexOf('b='))-1)) ;
		var couleur=window.location.search.substring(((window.location.search.indexOf('b='))+2),((window.location.search.indexOf('c='))-1)) ;
		var avec_fin=0;
		if(window.location.search.indexOf('d=')>0) {
			avec_fin=1;
			avec_fin=window.location.search.substring(((window.location.search.indexOf('c='))+2),((window.location.search.indexOf('d='))-1)) ;
			//alert("avec_fin");
		}
		var url="http://www.vigicrues.gouv.fr/ftp/mf/cruemax-mf-dept"+dept+".png?"+alea+""
//alert(dept)
</script>

<script type="text/javascript">			
			get_vigilance()
			if (document.layers) {
				firstBit='document.layers["';
				secondBit='"]';
				styleRef='';
				leftVar='.left';
				topVar='.top';
				heightVar='.clip.height';
				widthVar='.clip.width';
				function checksize() {
							if (maxheadroom != window.innerHeight || wideload != window.innerWidth) {
								document.location=document.location;
								}
				}
				var maxheadroom = window.innerHeight;
				var wideload = window.innerWidth;
				window.captureEvents(Event.RESIZE);
				window.onresize = checksize;
			} else if (document.all) {
				firstBit='document.all["';
				secondBit='"]';
				styleRef='.style';
				leftVar='.posLeft';
				topVar='.posTop';
				heightVar='.clientHeight';
				widthVar='.clientWidth';
			} else if (document.getElementById) {
				firstBit='document.getElementById("';
				secondBit='")';
				styleRef='.style';
				leftVar='.left';
				topVar='.top';
				heightVar='.clientHeight';
				widthVar='.clientWidth';
			}
	
		</script>
</head>
<body>
<div class="container">
 <div id="innerDiv"></div>
<a name="top" id="top" shape="rect"></a>


<table border="0" cellpadding="0" cellspacing="0" width="880">
  <tbody>
    <tr>
      <td colspan="1" id="fdMeteo2" rowspan="1" height="58" width="297">
	  	<div id="navMeteo" align="right">
		<a href="index.html" shape="rect">retour carte</a>
		</div>
		</td>
		
            <td colspan="1" id="fdUtil2" rowspan="1" valign="center">
                <div id="navUtil">
                    <a href="index.html" shape="rect">Actualiser la page</a>
                    <img src="Accueilhtml_fichiers/carreBleu.gif" height="5" width="13"/>
                    
                     <a href="tab_vigi_33.html"  shape="rect">Version tableau</a>
                  <img src="Accueilhtml_fichiers/carreBleu.gif" height="5" width="13"/>
                  
                    <a href="accessible.html"  shape="rect">Version accessible</a>
                  <img src="Accueilhtml_fichiers/carreBleu.gif" height="5" width="13"/>
                   
                    <script type="text/javascript">
                        document.write("<a href='data/QGFR16_LFPW_.pdf?"+alea+" shape='rect' target='_blank'>Carte noir et blanc</a>");
                    </script>
                    <img src="Accueilhtml_fichiers/carreBleu.gif" height="5" width="13"/>
                    <a href="javascript:window.print()" shape="rect">Imprimer</a>
                    <img src="Accueilhtml_fichiers/carreBleu.gif" height="5" width="13"/>
                    <a href="html/vigilance/guideVigilance/droits.html" shape="rect">Widget</a>
					 <img src="Accueilhtml_fichiers/carreBleu.gif" height="5" width="13"/>

                </div>
	                <div id="navTri">
                    <span id="navCons"><a href="html/vigilance/guideVigilance/consequence_conseil.html" shape="rect">Cons&eacute;quences et conseils</a></span>
                    <span id="navDang"><a href="html/vigilance/guideVigilance/dm_vent.html" shape="rect">Dangers m&eacute;t&eacute;orologiques</a></span>
                    <span id="navQuest"><a href="html/vigilance/guideVigilance/vigilance.html" shape="rect">Qu'est-ce que la vigilance ?</a></span>
                </div>
 </td>
    </tr>
  </tbody>
</table>


<!-- fin bandeau haut  -->



<table border="0" cellpadding="0" cellspacing="0" width="950">
  <tbody>
    <tr>
      <td colspan="1" rowspan="1"><!-- Header bulletin : Debut -->
        <table border="0" cellpadding="0" cellspacing="0" width="880">
          <tbody>
            <tr>
              <td colspan="1" rowspan="1" align="right" valign="left" width="183">
			  <script>
 				var url_dept=get_prev_dept(dept);
			  document.write("<a href="+url_dept+" shape='rect' target='_blank'>");
			  </script>
			  <img alt="Logo Mto France" src="Accueilhtml_fichiers/logMF_bull.jpg" border="0" height="27" width="142" /></a>
			              <!-- <a href="index.html" target="_blank"> <img src="data/QGFR08_LFPW_.gif" alt="vigilance.meteofrance.com"   width="71" height="70" /> --> </a>  </td>
              <!-- 0 bulletin ou 1 bulletin indirect -->
              <td colspan="1" rowspan="1" align="center" width="697">

			  <script>
			  // affiche le nom du dept
				document.write("<h1>"+dept_obj[dept]+"</h1>");
				document.write("</td>");
				
				</script>

				
              <!-- 1 bulletin -->
              <!-- 2 bulletins -->
            </tr>
          </tbody>
        </table>
		
		
        <!-- Header bulletin : Fin -->
        <!-- Corps bulletin : Debut -->

        <table border="0" cellpadding="5" cellspacing="0" height="360" width="880" >
          <tbody>
            <tr>
              <!-- 0 bulletin -->
              <!-- Pas de Bulletin National -->
              <td colspan="1" rowspan="1" width="226"><img src="Accueilhtml_fichiers/pixTrans.gif" height="1" width="220" /></td>
              <td colspan="1" rowspan="1" width="634"  VALIGN="top"  >
              
              <!-- CADRE INFO VIGILANCE -->
                <table border="0" cellpadding="0" cellspacing="0" width="495"  height="90" >
                  <tr>
                      <td class="texte12_bull"  VALIGN="top    colspan="1" rowspan="1">
					  <script>
                      document.write("<iframe width='501' height='220' frameborder='0'  scrolling='no' src='bulletin_SIV_complet.html?a="+dept+"&b=1&c='></iframe> ");

                    if(couleur==1)document.write(" <span style='background-color: rgb(40, 215, 97);'> D&eacute;partement en vigilance verte.</span> </b><br> Pas de vigilance particuli&egrave;re. ");
                    
                    else if(couleur==2)document.write(" <span style='background-color: rgb(255, 255, 0);'> D&eacute;partement en vigilance "+ tab_baratin_plus_cote[dept]+"</b></span><br> Soyez attentif si vous pratiquez des activit&eacute;s sensibles au risque m&eacute;t&eacute;orologique ou &agrave proximit&eacute d&prime;un rivage ou d&prime;un cours d&prime;eau; des ph&eacute;nom&egrave;nes habituels dans la r&eacute;gion mais occasionnellement et localement dangereux  sont en effet pr&eacute;vus; tenez-vous au courant de 		l&rsquo;&eacute;volution de la situation.");
                    else if(couleur==3)document.write(" <span style='background-color: rgb(255, 196, 0);'> D&eacute;partement en vigilance "+ tab_baratin_orange[dept]+"</span> </b><br> ");
                    else if(couleur==4)document.write(" <span style='background-color: rgb(255, 0, 0);'> D&eacute;partement en vigilance "+ tab_baratin_rouge[dept]+"</span> </b><br> ");
					</script>
					<br><br></td></tr></table>
                   
                <!-- CADRE INFO VIGILANCE CRUES -->
                <table border="0" cellpadding="0" cellspacing="0" width="495">
                  <tbody>
                    <tr>
                      <td colspan="3" rowspan="1" style="background: url('img/vigilance/images/cart_droitsH.gif') no-repeat scroll 0pt 0pt transparent;">
					  <img src="Accueilhtml_fichiers/pixTrans.gif" height="15" width="1" /></td>
                    </tr>
                    <tr>
                      <td colspan="1" rowspan="1" style="width: 1px;" bgcolor="#357097">
					  <img src="Accueilhtml_fichiers/pixTrans.gif" height="8" width="1" /></td>
                      <td colspan="1" rowspan="1"><table style="margin-left: 10px;" border="0" cellpadding="0" cellspacing="0" width="90%">
                          <tbody>
                            <tr>
                              <td class="verda11" colspan="2" rowspan="1">
<!-- ici futur mention venant au dessus de la carte -->

                              <span class="verda12_gui">Informations sur les crues :</span></td>
                            </tr>
                            <tr>
                              <td class="verda11" colspan="1" rowspan="1" valign="middle" width="350">Consultez
                                la carte et les bulletins de <a href="http://www.vigicrues.gouv.fr/" shape="rect" target="_blank">Vigicrues</a><span class="verda12_gui"></span></td>
                              <td colspan="1" rowspan="1">
								<script>
								document.write("<img alt='Carte de vigilance crues' src='"+url+"' align='top' border='0' height='68' width='63'>");
								</script>
                              </td>
                            </tr>
                          </tbody>
                      </table></td>
                      <td colspan="1" rowspan="1" style="width: 1px;" bgcolor="#357097"><img src="Accueilhtml_fichiers/pixTrans.gif" height="8" width="1" /></td>
                    </tr>
                    <tr>
	
	
	                      <td colspan="3" rowspan="1" style="background: 
url('img/vigilance/images/cart_droitsB.gif') no-repeat scroll
 0pt 0pt transparent;"><img src="Accueilhtml_fichiers/pixTrans.gif" 
height="20" width="1" /></td>

					
              </tr>
                  </tbody>
                </table>
                <br />
	                <br />
			
               <!-- CADRE INFO PREVISIONS DEPARTEMENT -->
                <table
 border="0" cellpadding="0" cellspacing="0" width="495">
                  <tbody>
                    <tr>
					
					
					
		                 <td colspan="3" rowspan="1" style="background: 
url('img/vigilance/images/cart_droitsH.gif') no-repeat scroll
 0pt 0pt transparent;"><img src="Accueilhtml_fichiers/pixTrans.gif" 
height="15" width="1" /></td>
			

                    </tr>
	<script>	
	
	if(avec_fin==1){
			var url="Bulletin_fin_eve.html?a=dept"+dept+"&b=1&d="
			document.write(" <tr><td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td>");
            document.write(" <td class='verda12_gui' colspan='1' rowspan='1' style='padding-left:10px;'><b>Ev&eacute;nement m&eacute;t&eacute;orologique termin&eacute;</b><br/></td>")
            document.write("  <td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td> </tr>  <tr>")
            document.write(" <td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td>");
            document.write("  <td class='verda11' colspan='1' rowspan='1' style='padding-left:10px;'>Consulter le <a escapeXml='false' href="+url+" shape='rect'>bulletin de fin de vigilance</a><br/></td>");
        document.write("<td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td> </tr>");
		}
	if(avec_fin==2){
			var url="Bulletin_fin_eve.html?a=dept"+dept+"&b=2&d="
			document.write(" <tr><td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td>");
            document.write(" <td class='verda12_gui' colspan='1' rowspan='1' style='padding-left:10px;'><b>Ev&eacute;nement m&eacute;t&eacute;orologique termin&eacute;</b><br/></td>")
            document.write("  <td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td> </tr>  <tr>")
            document.write(" <td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td>");
            document.write("  <td class='verda11' colspan='1' rowspan='1' style='padding-left:10px;'>Consulter le <a escapeXml='false' href="+url+" shape='rect'>bulletin de fin de vigilance avalanche</a><br/></td>");
        document.write("<td bgcolor='#357097' colspan='1' rowspan='1'><img height='8' src='img/vigilance/images/pixTrans.gif' width='1'/></td> </tr>");
		}
		
	</script>				
					
					
					
					
					
                    <tr>
                      <td colspan="1" rowspan="1" 
bgcolor="#357097"><img src="Accueilhtml_fichiers/pixTrans.gif" height="8" 
width="1" /></td>
                      <td class="verda11" colspan="1" rowspan="1" 
style="padding-left: 10px;"><p><strong>Consultez les pr&eacute;visions m&eacute;t&eacute;o sur
                          <script>
 var url_dept=get_prev_dept(dept);
 // cas Andorre
 if(dept!=99) document.write("<a href='"+url_dept+"' shape='rect' target='_blank'>votre d&eacute;partement</a> ou"); 
                            </script>
                          
                          <script>
// liste dept par region faire un objet {dept:reg  }reg_eco_obj["01"]
var url_region=get_prev_region(dept);
 document.write("<a href='"+url_region+"' shape='rect' target='_blank'>votre r&eacute;gion</a>");
                          </script>
                        </strong></p>
						<p>Consultez le <a href="Bulletin_nat.html?dept=france&b=" shape="rect">Bulletin national</a><br/>
pour conna&icirc;tre la situation m&eacute;t&eacute;o
sur les autres d&eacute;partements<br/>
						</p>					  </td>
                        
                        
                      <td colspan="1" 
rowspan="1" bgcolor="#357097"><img src="Accueilhtml_fichiers/pixTrans.gif" 
height="8" width="1" /></td>
                    </tr>
                    <tr>
	                      <td colspan="3" rowspan="1" style="background: 
url('img/vigilance/images/cart_droitsB.gif') no-repeat scroll
 0pt 0pt transparent;"><img src="Accueilhtml_fichiers/pixTrans.gif" 
height="20" width="1" /></td>
                    </tr>
              </table></td>
            </tr>
          </tbody>
        </table>
 
            <!-- CADRE LIEN SHOM -->
<table border="0" cellpadding="0" cellspacing="0" class="taille495"  align="center">
<tr><td  colspan="1" rowspan="1"></td>
<script>
for(var im=0;im<tab_maree.length;im++){
	if(tab_maree[im]==dept) break;
}
if(im<tab_maree.length){
	document.write("<td  colspan='1' rowspan='1'  class='verda11' >Consulter les <a class='linkExtBleu' href='"+url_maree+"' onclick='window.open(this.href);return false;' shape='rect' title='Service Hydrographique et Oc&eacute;anographique de la Marine [nouvelle fen&ecirc;tre]'>coefficients  et horaires de mar&eacute;e</a>")
	document.write("<br/>(Service Hydrographique et Oc&eacute;anographique de la Marine)</td>")
}
</script>
	<td colspan="1" rowspan="1"></td></tr>

</table>             
        <!-- Corps bulletin : Fin -->
        <!-- Footer bulletin : Debut -->
        <!-- 1 bulletin -->
        <table border="0" cellpadding="0" cellspacing="0" width="880">
          <tbody>
            <tr>
              <td 
colspan="1" rowspan="1" align="right" width="127"><span class="retour"><a
 href="javascript:history.back()" shape="rect">Page pr&eacute;c&eacute;dente</a></span></td>
              <td
 class="texte10" colspan="1" rowspan="1" align="right" valign="bottom" 
width="656">Copyright M&eacute;t&eacute;o-France </td>
            </tr>
          </tbody>
        </table>
        <!-- Footer bulletin : Fin --></td>
    </tr>
  </tbody>
</table>

</div>


		<script language="JavaScript1.1">
 		aff_vigi(70,100)

		var delay=1000;  /* ms */
	//	var TimeID = setInterval("last_image()", delay);
</script>

<script type="text/javascript">
<!--
var refer=""+document.referrer+"";
window.nocookie=true ;	
xtnv = document;        //parent.document or top.document or document         
xtsd = "http://logc279";
xtsite = "541706";
xtn2 = "";        // level 2 site ID
xtpage = "bulletin_sans_vigilance_nocookie";        //page name (with the use of :: to create chapters)
xtdi = "";        //implication degree
xt_multc = "";		//all the xi indicators (like "&x1=...&x2=....&x3=...")
xt_an = "";        //user ID
xt_ac = "";        //category ID
//do not modify below
if (window.xtparam!=null){window.xtparam+="&ac="+xt_ac+"&an="+xt_an+xt_multc;}
else{window.xtparam="&ac="+xt_ac+"&an="+xt_an+xt_multc;};
//-->
</script>
<script type="text/javascript" src="js/xtcore.js"></script>
<noscript>
<img width="1" height="1" alt="" src="http://logc279.xiti.com/hit.xiti?s=541706&s2=&p=&di=&an=&ac=" >
</noscript>



</body>
</html>
domoticz beta/RaspBerry PI3 stretch
https://pon.fr github
jackslayter
Messages : 1040
Inscription : 30 sept. 2014, 14:40
Localisation : Isère (38)

Re: récupérer le texte d'une page web

Message par jackslayter »

oui ça

Code : Tout sélectionner

<!-- CADRE INFO VIGILANCE -->
                <table height="90" border="0" cellpadding="0" cellspacing="0" width="495">
                  <tbody><tr>
                      <td class="texte12_bull" 1"="" rowspan="1" valign="top    colspan=">
                 <script>
                      document.write("<iframe width='501' height='220' frameborder='0'  scrolling='no' src='bulletin_SIV_complet.html?a="+dept+"&b=1&c='></iframe> ");

                    if(couleur==1)document.write(" <span style='background-color: rgb(40, 215, 97);'> D&eacute;partement en vigilance verte.</span> </b><br> Pas de vigilance particuli&egrave;re. ");
                   
                    else if(couleur==2)document.write(" <span style='background-color: rgb(255, 255, 0);'> D&eacute;partement en vigilance "+ tab_baratin_plus_cote[dept]+"</b></span><br> Soyez attentif si vous pratiquez des activit&eacute;s sensibles au risque m&eacute;t&eacute;orologique ou &agrave proximit&eacute d&prime;un rivage ou d&prime;un cours d&prime;eau; des ph&eacute;nom&egrave;nes habituels dans la r&eacute;gion mais occasionnellement et localement dangereux  sont en effet pr&eacute;vus; tenez-vous au courant de       l&rsquo;&eacute;volution de la situation.");
                    else if(couleur==3)document.write(" <span style='background-color: rgb(255, 196, 0);'> D&eacute;partement en vigilance "+ tab_baratin_orange[dept]+"</span> </b><br> ");
                    else if(couleur==4)document.write(" <span style='background-color: rgb(255, 0, 0);'> D&eacute;partement en vigilance "+ tab_baratin_rouge[dept]+"</span> </b><br> ");
               </script><iframe scrolling="no" src="Bulletin%20vigilance%20M%C3%A9t%C3%A9o%20France_fichiers/bulletin_SIV_complet.htm" frameborder="0" height="220" width="501"></iframe>  <span style="background-color: rgb(255, 255, 0);"> 
Département en vigilance jaune Orages

Code : Tout sélectionner

</span><br>
 Soyez attentif si vous pratiquez des activités sensibles au risque
météorologique ou à proximité d′un rivage ou d′un cours d′eau; des
phénomènes habituels dans la région mais occasionnellement et localement
 dangereux  sont en effet prévus; tenez-vous au courant de       l’évolution
 de la situation.
               <br><br></td></tr></tbody></table>
Raspberry Pi + RFLink + Domoticz Beta
Oregon - 3x Thgr122Nx / Chacon - micromodule 200w, télécommande 3b et 16b, 2x module 1000w, détecteur de fumée, contact de porte, 2x prise 3500w / OWL - CM180 / TRC02 v2 RGB 3M / Cheap - PIR, contact de porte
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: récupérer le texte d'une page web

Message par vil1driver »

MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
jackslayter
Messages : 1040
Inscription : 30 sept. 2014, 14:40
Localisation : Isère (38)

Re: récupérer le texte d'une page web

Message par jackslayter »

j'ai vu ce script mais si l'alerte est jaune il n'y a pas de risque (http://vigilance.meteofrance.com/data/NXFR34_LFPW_.xml) alors que sur http://vigilance.meteofrance.com/Bullet ... 75&b=2&c=1 il y en a un
Raspberry Pi + RFLink + Domoticz Beta
Oregon - 3x Thgr122Nx / Chacon - micromodule 200w, télécommande 3b et 16b, 2x module 1000w, détecteur de fumée, contact de porte, 2x prise 3500w / OWL - CM180 / TRC02 v2 RGB 3M / Cheap - PIR, contact de porte
jackslayter
Messages : 1040
Inscription : 30 sept. 2014, 14:40
Localisation : Isère (38)

Re: récupérer le texte d'une page web

Message par jackslayter »

en fait ça ne peut pas marcher car le "b=" c'est la couleur de la vigilance

j'ai trouvé autre chose qui marche et qui est plus détaillé
http://alerte.vigilance-meteo.fr/index.html
Raspberry Pi + RFLink + Domoticz Beta
Oregon - 3x Thgr122Nx / Chacon - micromodule 200w, télécommande 3b et 16b, 2x module 1000w, détecteur de fumée, contact de porte, 2x prise 3500w / OWL - CM180 / TRC02 v2 RGB 3M / Cheap - PIR, contact de porte
Répondre