Jump to content

I can't reach elements between <span> here <span> ?


wafa

Recommended Posts

Hello out there! 

Firstly thanks to help people coding.

I'm trying to extract information(name and speciality)  from this link: http://www.sante-dz.com/carteinfomed.php?spe=39&nom=&rig=Alger&pubspace=i&firsturl=L21lZGVjaW5zLnBocD90aXQ9bCZtYXhSb3dzX21lZGVjaW5zPTEwMCZzcGU9MzkmcmlnPUFsZ2Vy

1-  when I try to reach the text written between <span> here <span>, I recuperate all the texts written in the same tag but only the desired information couldn't be reached,

2- I recuperate a link gathering information of every doctor,, but can't also extract just the linkw which is contained in a string

 

here is my simple code:

<!DOCTYPE html>
<html lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Parser...</title>
<link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>
<body>
<div class="wrapper">
<h1>La base des medecins algeriens </h1>
<?php
require_once 'simple_html_dom.php';
                     //Create an object simple_html_dom()
                    $html = new simple_html_dom();
                    //Create an object simple_html_dom()
                    $htmll = new simple_html_dom();
 
                     // load the html file
 
                     //All links of doctors information
                    foreach($html->find( 'td[class=txtgray9all] div') as $info)
                        echo $info->onclick. '<br>'; // the string recuperated should be parsed to extract the desired 
                        //  $parsedlink= 
                       // echo  $htmll->load_file('http://www.sante-dz.com/carteinfomed.php?'.$parsedlink);
                    
                    foreach($htmll->find('span.txtblue92ball') as $e)
                        echo $e->outertext . '<br>';// i don't get any result
 
                        
                    
                ?>
</div>
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/295134-i-cant-reach-elements-between-here/
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.