I am using the following bit of code to scrape and display some information:
foreach ($matches[0] as $match) {
// First, get title
preg_match ("/<a([^`]*?)</", $match, $temp);
$title = $temp['1'];
$title = strip_tags($title);
$title = trim($title);
echo "<item>\n";
echo "\t\t\t<title>" . strip_tags($title) . "</title>\n";
echo "\t\t\t<content:encoded><![CDATA[ \n";
echo $text . "\n";
echo " ]]></content:encoded>\n";
echo "\t\t\t<dc:creator>" . strip_tags($author) . "</dc:creator>\n";
echo "\t\t</item>\n";
The section in bold is what I need to mine out:
height="80"></a></td>
<td class="productListing-data">300-10303</td>
<td class="productListing-data">
Kingavon Pro User 720W 2 Stroke Generator
But I am getting the following error:
A semi colon character was expected. Error processing resource 'http://www.ratemybuilder.co.uk/scrape.php'. Line 17, Posit...
<title>href="http://dropshiponline.co.uk/product_info.php?cPath=46_99&products_id=362&osCsi d=d3780c195b6c62...
I believe that it is because of the & in the URL. How do I remove?