Hi guys..
Im have a problem with this piece of code
<?
set_time_limit(-1);
ob_implicit_flush(1);
flush();
ob_end_flush();
$strURL = "";
if(isset($_POST["crawlUrl"]))
$strURL = $_POST["crawlUrl"];
function getMatches($strMatch,$strContent)
{
if(preg_match_all($strMatch,$strContent,$objMatches))
{
return $objMatches;
}
return "";
}
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="frmExtract" method="post" action="">
URL: <input name="crawlUrl" type="text" id="crawlUrl" size="50" value="<? print $strURL;?>" >
<input name="btnCrawl" type="submit" value="Crawl Data">
</form>
<br>
<br>
<?
if($strURL != "")
{
$strListingUrl = $strURL;
while(true)
{
$strContent = file_get_contents($strListingUrl);
$strListMatches = '!<li class="vehicle-images"><a href=".*?" title=".*?"><span>.*?</span></a></li>!isU';
$objListMatches = getMatches($strListMatches,$strContent);
print_r($objListMatches[1]);
if($objListMatches == "" || count($objListMatches[1]) == 0)
{
print "No List found or Invalid URL<br>";
}
}
}
?>
</body>
</html>
I want to extract the titles of ads from my site
http://www.carzone.ie/search/results?searchsource=browse&cacheBuster=1256634750309620#nParam=200590%2B219%2B147&sortby=County|1&channel=CARS¤cy=EUROS&searchResultsView=SPREADSHEET&maxrows=30&page=1
Can anybody help me?
What is wrong with the code as it doesnt seem to be working 🙁
What does the characters ! mean in this regular expression
'!<li class="vehicle-images"><a href=".*?" title=".*?"><span>.*?</span></a></li>!isU';
and also what does the isU mean?
Thanks