Ciao a tutti , sono alle prime armi e sto cercando di fare uno scraper che mi servirebbe per il mio sito web, lo scraper dovrebbe prelevare questa testo: "Segnalibri 3D - Lupo nella Neve"
da questa porzione di codice:
codice:
<tbody><tr>
<td class="pageHeadingProduct" valign="top"><h1>Segnalibri 3D - Lupo nella Neve</h1>
<span class="smallText"> Codice Prodotto BOOK05</span>
</td>
</tr>
</tbody>
Ho provato in questa maniera ma lo script mi restituisce sempre l' errore "Name not found"
codice:
// name
if (preg_match('~<td[^>]*?class="pageHeadingProduct"[^>]*>([^<]+)~is', $content, $m)) {
$item['Name'] = trim(html_entity_decode(strip_tags($m[1]), ENT_QUOTES, 'UTF-8'));
}
else {
$this->_log(MESSAGE, 'Name not found. Skip.');
return;
}
Please help me