Hi,
My code:
<?php
/**
* @author Peter Dräxler
* @copyright 2010
*/
header('Content-type: text/plain');
require('simple_html_dom.class.php');
$i = 47;
for ($i = 47; $i <= /*96*/47; $i++) {
$html = file_get_html('http://plotter.cz/index.php?option=com_content&view=article&id='. $i);
$nazov = $html->find('td[class=contentheading]', 0)->plaintext;
$nazov = str_replace("\t", '', $nazov);
$clanok = $html->find('table[class=contentpaneopen]', 1);
$text = str_replace("\n", '', $clanok);
// exit(str_replace("\n", "", $text));
echo $nazov. '||'. $text. "tu_ide\nnovy_riadok";
}
?>
Output:
Nové velkoformátové tiskárny||<table class="contentpaneopen"><tr><td valign="top"><!-- velkoformátové tiskárny CANON -->
<table width="100%" cellspacing="2" cellpadding="10" border="0" valign="all" style="text-align: justify;">
<tbody><tr><td height="70" width="300"><strong><a href="/index.php?option=com_content&view=article&id=113&Itemid=70" target="self" title="podrobnosti produktech kategorie CAD/GIS">CANON pro CAD/GIS</a></strong></td></tr><tr><td width="300"><a href="/index.php?option=com_content&view=article&id=113&Itemid=70" target="self" title="podrobnosti produktech kategorie CAD/GIS"><img height="150" width="200" border="0" src="/products/canon/cad_gis/pictures/ipf820_sml.png" alt="imagePROGRAF iPF810 a iPF820" /></a></td><td><p>Produkty určené zejména projekčním kancelářím, architektům, stavebním společnostem. Velkoformátové tiskárny ve formátech 17"/A2 až 44"/B0</p>
<p><a href="/index.php?option=com_content&view=article&id=113&Itemid=70" target="_self" title="podrobnosti produktech kategorie CAD/GIS">Podrobnosti o produktech ... </a></p></td></tr>
</tbody>
</table>
<br />
<table width="100%" cellspacing="2" cellpadding="10" border="0" valign="all" style="text-align: justify;">
<tbody><tr><td height="70" width="300"><strong><a href="/index.php?option=com_content&view=article&id=187&Itemid=70" target="self" title="podrobnosti produktech kategorie grafické">CANON pro grafiku</a></strong></td></tr><tr><td width="300"><a href="/index.php?option=com_content&view=article&id=187&Itemid=70" target="self" title="podrobnosti produktech kategorie grafické"><img height="148" width="200" border="0" src="/products/canon/graphic/pictures/ipf8000s_sml.png" alt="imagePROGRAF iPF8000s" /></a></td><td><p>Velkoformátové tiskárny určené zejména grafickým agentůrám, fotoateliérům. Velkoformátové tiskárny ve formátech 17"/A2 až 60"/A0L</p>
<p><a href="/index.php?option=com_content&view=article&id=187&Itemid=70" target="_self" title="podrobnosti produktech kategorie grafické">Podrobnosti o produktech ... </a></p></td></tr>
</tbody>
</table>
<br />
<!-- Zpět -->
<a href="/index.php" target="_self" title="<<< Zpět na hlavní stranu"><<< Zpět na hlavní stranu</a>
</td></tr></table>tu_ide
novy_riadok
Why is in output many new lines? I don't understand it. Please explain me it.
Sorry for my english.
Thank you.