benim kodlar şöle hocam :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
</head>
<body>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">resim</th>
<th scope="col">yazi</th>
<th scope="col">fiyat</th>
</tr>
</thead>
<tbody>
<?php
function minify($buffer) {
$search = array(
'/\>[^\S ]+/s',
'/[^\S ]+\</s',
'/(\s)+/s'
);
$replace = array(
'>',
'<',
'\\1'
);
$buffer = preg_replace($search, $replace, $buffer);
$buffer = str_replace('> <', '><', $buffer);
$buffer = str_replace("\t", '', $buffer);
$buffer = preg_replace('/<!--.*?-->/ms', '', $buffer);
return $buffer;
}
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://www.olx.ro/d/oferta/',
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => http_build_query(array('search' => array('category_id' =>1251), 'page' => @$_GET['page'])),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_HEADER => true
]
);
$buffer = minify(curl_exec($ch));
curl_close($ch);
preg_match_all('#<img class="css-1bmvjcs" src="(.+?)" alt="(.+?)">#si', $buffer, $matches);
preg_match_all('#<div class="css-g5mtbi-Text">(.+?)</div>#si',$buffer,$fiyat);
print_r($fiyat);
$b=0;
foreach ($matches[2] as $index => $img) {
?>
<tr>
<td><img src="<?php echo $matches[1][$index]; ?>" style="width:70px; height:70px;o bject-fit:cover;"></td>
<td><?php echo $matches[2][$index]; ?></td>
<td><?php echo $fiyat[0][$b]; ?></td>
</tr>
<?php
$b++;
$page= @$_GET['page'];
}
?>
</tbody>
</table>
</body>
</html>ama çalışmıyor çalıştıramadım