I’m trying to select either a class or an id using PHP Simple HTML DOM Parser with absolutely no luck. My example is very simple and seems to comply to the examples given in the manual(PHP Simple HTML DOM Parser) but it just wont work, it’s driving me up the wall.
Well i need more examples - probly i have overseen something!
If anybody has a working example of Simple-html-dom-parser…i would be happy.
The examples on the developersite are not very helpful.
your dilbertone
BTW - thinking about the most elegant way, i think it is the most pretty way would be to do it with perl - So i think if all fails i should try it with HTML::TableExtract or…
Your HTML is indeed invalid.
I’d give you an example if I could remember where I used the simple parser, usually I use the DOM.
I suppose you did already look at the basic examples PHP: Basic usage - Manual ?
<?php
include('simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('nrw_test.html');
//Find all anchors, returns a array of element objects
//$ret = $html->find('a');
//Find all <div> which attribute id=foo
//$ret = $html->find('div[id=ldstabTitel]');
// Find all links
foreach ($html->find('a') as $element)
echo $element->href. '<br>';
echo $element->innertext.'<br>';
?>
All i get is the e-mail-adress - but nothing more…
Axeia, do you have any hint how to extract the data out of the table -