Désèspère Parser html balise Div

Résolu
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010 - 16 oct. 2010 à 16:45
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010 - 20 oct. 2010 à 23:44
Salut à toute la communauté CSS
Alors voilà depuis début septembre je cherche comment Parser le code html de cette page http://www.star.fr/fr/accueil.html
Pour récupérer le
.
Le but ? Pyrater la star Nan ! mais me faciliter la vie, le matin un coup d'iphone sur la page que j'hébergerais sur mon ftp, et hop on choisi le parking qui a le plus de places dispos. Après ça peut être étendu sur les perturbations de réseau escalator...


J'ai cherché sur google, le fofo de Codes S sources est téléchargé les Deux parseurs en open source (un en russe l'autre en anglais), téléchargé un home made parseur (fonctionne pas) ai adapté trois propositions de codes sur divers fofos l'un sur un tableur excell, l'autre pour des meta et le dernier pour une page html mais avec juste un certain texte, et ...
Nada...J'y arrive pas

Donc voilà si une bonne âme charitable veut bien m'aider sur ce projet car là les nerfs sont déjà bien entamés et le pauvre clavier de mon netbook bien amoché .

Kenavo all !

17 réponses

jediNoobiewan Messages postés 67 Date d'inscription mardi 25 janvier 2005 Statut Membre Dernière intervention 20 octobre 2010
18 oct. 2010 à 11:52
Hello...
Si tu cherches juste à récupérer le contenu de la div :
$page = file_get_contents("http://www.star.fr/fr/accueil.html");
$div = preg_replace('/.*
(.*)<!-- END: Content of extension "ics_parc_relais".*/s', '$1', $page);
$xml = simplexml_load_string('
' . $div);


De là tu as un objet simple_xml avec tout dedans :)

J'espère que ça aura pu t'aider un peu
3
jediNoobiewan Messages postés 67 Date d'inscription mardi 25 janvier 2005 Statut Membre Dernière intervention 20 octobre 2010
19 oct. 2010 à 08:13
Bonjour bonjour,

Sisi mon code est exploitable ^^ Allé je te mets la suite pour te donner une piste ;)
$page = file_get_contents("http://www.star.fr/fr/accueil.html");
echo $div = preg_replace('/.*
(.*)<!-- END: Content of extension "ics_parc_relais".*/s', '$1', $page);
$xml = simplexml_load_string('
' . $div);
foreach($xml->div as $div){
if(isset($div->table)){
foreach($div->table->tbody->tr as $tr){
foreach($tr->td as $td){
echo '' . var_dump($td) . '

';
}
}
}
}


En espérant que ça puisse t'aider ;)
3
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
18 oct. 2010 à 23:31
Ouais merci maître Jedi, par contre j'en fais quoi de mon objet simple_xml ? je l'appel en require ? ton code semble bon mais easy php veut pas me le faire tourner je pense oublier quelque chose quelque part.
Il ressemble d'ailleurs énormément à un que j'avais pas réussi à adapter, j'arrivais pas non plus à récupérer le traitement du parseur...
0
kohntark Messages postés 3705 Date d'inscription lundi 5 juillet 2004 Statut Membre Dernière intervention 27 avril 2012 30
19 oct. 2010 à 01:31
Salut,par contre j'en fais quoi de mon objet simple_xml ?

par contre j'en fais quoi de mon objet simple_xml ?
on code semble bon mais easy php veut pas me le faire tourner je pense oublier quelque chose quelque part.

... peut être, peut être pas, à dire vrai personne ne peut le savoir sans connaitre le code que tu as mis en place et les erreurs que tu obtiens.
Qui plus est le code de JediNoobiewan n'est pas exploitable en l'état, raison de plus pour nous montrer comment tu t'es inspiré de ses pistes.


Cordialement,



Kohntark -
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
19 oct. 2010 à 23:17
Génial la suite du code fonctionne bien sauf a la ligne du
$xml = simplexml_load_string('
' . $div);

j'ai une erreur qui en ressort, je ne sais toujours pas comment traiter ce xml.

Question simple j'ai essayé de rajouter une seconde fois ce code pour une seconde div, et là par contre je n'ai rien qui s'affiche c'est normal ??
(en gros j'ai deux fois ton code avec deux cibles div différentes)

En tout cas génial ça marche (sauf sur mon iphone il veut pas me charger la page originale, vas t'en savoir pourquoi...)
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
19 oct. 2010 à 23:18
Ps le code d'erreur :
Fatal error: Call to undefined function: simplexml_load_string() in c:\program files\easyphp 3.0\easyphp1-8\www\iphone\index.php on line 26

Désolé pour le double post
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 08:45
Rah ce matin après un rapide test chez free sur mon ftp ça marche pas, et le code est bon, il tourne en local mais pas en hébergement.
La raison ? Free a tout simplement verrouillé pas mal de scripts...

Donc, il me reste deux solutions, la première je bascule en parsing html via java je présume ?
La seconde, j'installe mysql et php sur mon iphone...

Pour la première vous en pensez quoi ?
(pour un fois que j'ai un code qui marche ...)

dégouté
0
jediNoobiewan Messages postés 67 Date d'inscription mardi 25 janvier 2005 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 09:01
Hello,

Bon que tu n'aies rien qui s'affiche pour une deuxième div... c'est normal :p, l'expression régulière pour récupérer la première est spécifique à elle, il faudrait que tu remplaces <!-- END: Content of extension "ics_parc_relais".* par ce qu'il y a après la div dans le code HTML.

Ensuite si tu es le seul à utiliser ton bout de code et bien installe ton serveur chez toi et accèdes y via ton iPhone, je suppose que tu dois avoir une IP fixe donc c'est pas chiant :D

Tu voudrais faire quoi exactement après avoir récupéré la div ? Juste l'afficher ? Traiter les données ? Les modifier ?




@++
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 09:07
OUi oui pour la seconde div j'ai déjà modifié mon code je te le poste quand j'arrive à ma fac bloquée, mais il marche pas on regarde ça taleur ...
Ensuite pour le serveur hébergé chez moi ça m'intéresse mais il faut que j'ai un pc d'allumé ???

Et pour ma div nan c'est juste un affichage, en un clin d'oeil sur ma page j'ai accès à toutes les infos de la star que j'ai sélectionné.

merci pour ton investissement !
0
kohntark Messages postés 3705 Date d'inscription lundi 5 juillet 2004 Statut Membre Dernière intervention 27 avril 2012 30
20 oct. 2010 à 09:43
Salut,

IL serait déjà bien de savoir ce qui bloque exactement chez Free.
Est ce la même erreur que celle que tu donnais juste avant (qui est celle que tu avais en local) ?
Tu es bien en PHP5 chez Free ?
S'il ne s'agit pas d'un problème au niveau de file_get_contents() il est assez simple d'y remédier.


Sisi mon code est exploitable ^^

J'avais lu trop vite ... méa culpa



Cordialement,

Kohntark -
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 15:58
Hello, alors voici le code erreur que free m'affiche je ne pense pas que ça vienne du file_get

En essayant de charger l'URL : http://www.star.fr/fr/accueil.html

L'erreur suivante a été rencontrée :

    * Accès interdit.

      La configuration du contrôle d'accès interdit à votre requête d'être acceptée à cette heure-ci. Veuillez contacter votre prestataire de service si vous pensez que ceci n'a pas lieu d'être. 


Generated Tue, 19 Oct 2010 21:38:17 GMT by pageperso.priv.free.fr (squid/3.0.STABLE21)

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : StartTag: invalid element name in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www. in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Entity 'nbsp' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <TITLE>ERREUR : L'URL demandée n'a pu être chargée</TIT in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <TITLE>ERREUR : L'URL demandée n'a pu être chargée</TIT in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Entity 'ecirc' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <TITLE>ERREUR : L'URL demandée n'a pu être chargée</TIT in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <TITLE>ERREUR : L'URL demandée n'a pu être chargée</TIT in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 5: parser error : Opening and ending tag mismatch: META line 2 and HEAD in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: </HEAD> in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 7: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'URL demandée n'a pu être chargée
 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 7: parser error : Entity 'ecirc' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'URL demandée n'a pu être chargée
 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 7: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'URL demandée n'a pu être chargée
 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 8: parser error : Specification mandate value for attribute noshade in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <HR noshade size="1px"> in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 8: parser error : attributes construct error in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <HR noshade size="1px"> in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 8: parser error : Couldn't find end of Start Tag HR line 8 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: <HR noshade size="1px"> in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 10: parser error : Entity 'nbsp' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: En essayant de charger l'URL : in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 13: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'erreur suivante a été rencontrée : in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 13: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'erreur suivante a été rencontrée : in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 13: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'erreur suivante a été rencontrée : in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 13: parser error : Entity 'nbsp' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: L'erreur suivante a été rencontrée : in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 17: parser error : Entity 'egrave' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Accès interdit. in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 20: parser error : Entity 'ocirc' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: La configuration du contrôle d'accès interdit à votre requ&e in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 20: parser error : Entity 'egrave' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: La configuration du contrôle d'accès interdit à votre requ&e in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 20: parser error : Entity 'agrave' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: La configuration du contrôle d'accès interdit à votre requ&e in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 20: parser error : Entity 'ecirc' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: nfiguration du contrôle d'accès interdit à votre requê in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 20: parser error : Entity 'ecirc' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: du contrôle d'accès interdit à votre requête d'ê in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 21: parser error : Entity 'eacute' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: acceptée à cette heure-ci. Veuillez contacter votre in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 21: parser error : Entity 'agrave' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: acceptée à cette heure-ci. Veuillez contacter votre in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 22: parser error : Entity 'ecirc' not defined in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: prestataire de service si vous pensez que ceci n'a pas lieu d'être. in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 23: parser error : Opening and ending tag mismatch: P line 19 and UL in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]:  in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 24: parser error : Opening and ending tag mismatch: LI line 15 and P in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: 

 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 32: parser error : Opening and ending tag mismatch: hr line 28 and body in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: </html> in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 32: parser error : Opening and ending tag mismatch: br line 27 and html in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: </html> in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag UL line 14 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag P line 12 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag P line 9 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag BODY line 5 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag HEAD line 2 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag HTML line 2 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 33: parser error : Premature end of data in tag div line 1 in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 26

Warning: Invalid argument supplied for foreach() in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 27
iub
ERREUR
L'URL demandée n'a pu être chargée

En essayant de charger l'URL : http://www.star.fr/fr/accueil.html

L'erreur suivante a été rencontrée :

    * Accès interdit.

      La configuration du contrôle d'accès interdit à votre requête d'être acceptée à cette heure-ci. Veuillez contacter votre prestataire de service si vous pensez que ceci n'a pas lieu d'être. 


Generated Tue, 19 Oct 2010 21:38:17 GMT by pageperso.priv.free.fr (squid/3.0.STABLE21)

Warning: Invalid argument supplied for foreach() in /mnt/111/sdb/3/a/benoit.guillot1/iphone/index.php on line 44


Bonne lecture :)
0
jediNoobiewan Messages postés 67 Date d'inscription mardi 25 janvier 2005 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 16:10
Hihi, c'est normal vu que l'expression régulière n'est pas bonne dans la variable $div il y a tout le code de la page et ce n'est plus une chaine xml valide donc simple_xml bah... il te dit plein de trucs méchants !




@++
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 16:14
Euuuhh traduction ?? , normalement le premier code doit fonctionner puisqu'il marche en local (sauf l'erreur signalé précédemment...)
Du coup je fais comment je passe par java ou il y a moyen de contrer ça ?
0
jediNoobiewan Messages postés 67 Date d'inscription mardi 25 janvier 2005 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 16:25
Il y bien un moyen avec la librairie php curl mais bon... je ne pense pas que ça soit installer sur les serveurs free, je ne les connais pas trop en même temps :p je pense que kohntark saura t'éclairer.

Sinon, pour en revenir au problème de départ vu que tu veux juste afficher la div pas besoin d'utiliser simple_xml donc les deux première lignes de code sont suffisantes. Tu utiliserais simple_xml si tu voulais exploiter le contenu mais bon si j'ai bien compris ce n'est pas le cas.



@++
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 18:49
Alors merci du coup le code corrigé j'ai plus mon erreur et ça tourne bien en local par contre chez free gniark ça passe pas voici mon code actuel (propre)
<?php
$page = file_get_contents("http://www.star.fr/fr/accueil.html");
echo $div = preg_replace('/.*
(.*)
.*/s', '$1', $page);

    if(isset($div->table)){
        foreach($div->table->tbody->tr as $tr){
            foreach($tr->td as $td){
                echo '' . var_dump($td) . '

';
            }
        }
    }


?>


Questions : Comment héberger ça chez moi me faut il une machine connectée 24/24 ?
As tu une équivalence de ce code en java ?
0
kohntark Messages postés 3705 Date d'inscription lundi 5 juillet 2004 Statut Membre Dernière intervention 27 avril 2012 30
20 oct. 2010 à 20:52
je pense que kohntark saura t'éclairer.

Concernant cURL sans doute, mais si il y a déjà des restrictions côté Free (que je ne connais absolument pas) avec un simple file_get_contents() je doute comme toi que cURL puisse donner de meilleurs résultats.

normalement le premier code doit fonctionner puisqu'il marche en local

Ca serait trop beau ça
Chaque serveur a ses limitations et son paramétrage propre.

Comment héberger ça chez moi me faut il une machine connectée 24/24 ?

Heu, oui, il faut qu'il soit allumé, sinon je ne vois pas comment tu pourrais y accéder. Tu peux toujours faire du "Wake On Wan", mais autant passer un peu de temps à trouver un hébergeur gratuit qui acceptera ton script.

alors voici le code erreur que free m'affiche je ne pense pas que ça vienne du file_get

D'après le message, et après une rapide recherche sur Google (que tu as dû également effectuer, non ?) il semble au contraire que ce soit le cas (en gros une limitation au niveau de l'appel d'URL externes)
Si il s'agit bien de ça (tiens nous au courant de tes recherches) et que tes éventuelles démarches auprès de Free ne donnent rien (parait que c'est possible ...) il te faudra abandonner cet "hébergeur".
En cherchant bien il y en a peut être des gratuits qui ne sont pas restrictifs de ce côté.

Cordialement,


Kohntark -
0
kitesurfzone Messages postés 10 Date d'inscription samedi 2 juin 2007 Statut Membre Dernière intervention 20 octobre 2010
20 oct. 2010 à 23:44
Hello all, alors pour vous répondre, mon problème a été contourné en installant php et l'équivalent de appache sur mon iphone.
J'ai fignolé mes codes rajouté un fond d'écran, un tableau, et une meta qui me recharge la page toutes les 30 secondes.
Le tour est joué ça marche et selon la console iphone, sans erreur.

Concernant mon hébergement chez free, oui en effet mes recherches sur google ont démontrées que l'hébergeur avait restreint certains scripts, afin de ne pas surcharger ses serveurs.
Je ne connais pas plus que toi les restrictions ...
Et ensuite concernant le flash get content, je ne crois pas de mémoire que c'était lui le petit démon qui faisait trembler les serveurs, mais un autre script qui avait la même ou quasi, utilité, en ajax.

Alors oui il me semble que je vais devoir changer d'hébergeur pour cette page et d'autres qui ne passent pas sur free...
en attendant je fonctionne en "local" sur mon iphone...

A suivre en tout cas merci pour le script de parsing en php il est terrible et me laisse une énorme porte ouverte pour intégrer des infos qui me semblent majeures dans ma vie rennaise de tous les jours.

ENfin pour l'hébergement local d'un éventuel appache, nan je n'ai pas encore de pc à laisser tourner 24/24, ça ne saurait tarder ^^

La partie parsing Php est résolue, reste plus que la mise en place sur free qui est un autre sujet.

L'un de vous a t'il déjà parser via java ?
Moi les seuls que j'avais ne tournaient vraiment pas du tout...
0
Rejoignez-nous