Hepsiburada üzerinden satış yapmaya başladım. Mevcut ürünlerin hepsini tek tek ekliyorum daha önce açılmış ürünlerden.
Dolayısıyla hepsiburadanın panelinden eklerken tüm ürünlerde tek tek ürün sayfasına giderek incelemek yorucu oluyor.
Bir kaç arkadaşa bot için fiyat sordum. Bütçemi aşıyordu. Hiç tecrübem de yok php konusunda ama dedim deneyeyim ne kaybederim. Sanırım zaman kaybettim

Aşağıdaki gibi bir kod yazdım. 3 saat uğraşarak
Bu php dosyasına gelen bilgileri excel'e kaydetmek istiyorum. Mümkün müdür, kolay mıdır, yapabilir miyim?Cevaplarınızı bekliyorum.
<head>
<meta charset="UTF-8">
</head>
<?php
ob_start();
error_reporting(E_ALL ^ E_NOTICE);
set_time_limit(0);
date_default_timezone_set('EUROPE/ISTANBUL');
$veri=file_get_contents("https://www.hepsiburada.com/ara?q=pleksan&sayfa=1");
preg_match_all('@(.*?)<a href="/(.*?)" data-sku="(.*?)"@si',$veri,$dlinkcek);
echo "<br>";
echo $say=count($dlinkcek[2]); echo " ürün bulundu.<br><br>";
//echo "<pre>";
//print_r($dlinkcek[2]);
//echo "/<pre>";
if ($say>0) {
for ($i=0; $i <$say ; $i++) {
echo "<br>";
echo $git="http://www.hepsiburada.com/".$dlinkcek[2][$i];
$veri=file_get_contents($git);
echo "<br>";
preg_match_all('@<span style="color:f28b00;font-family: helvetica;font-weight: bold;font-size:18px;letter-spacing:-0.3px">(.*?)</span>@si',$veri,$baslik);
echo ($baslik [0][0]);
echo "<br>";
preg_match_all('@<div id="productDescriptionContent">(.*?)</div>@si',$veri,$detay);
echo strip_tags($detay [0][0]);
echo "<br>";
preg_match_all('@Stok Kodu</th>
<td>(.*?)</td>
</tr>@si',$veri,$stokkodu);
echo strip_tags($stokkodu [0][0]);
echo "<br>";
preg_match_all('@<span data-bind="markupText:\'currentPriceBeforePoint\'">(.*?)</span>@si',$veri,$fiyattl);
echo strip_tags($fiyattl [0][0]);
echo ",";
preg_match_all('@<span data-bind="markupText:\'currentPriceAfterPoint\'">(.*?)</span>@si',$veri,$fiyatkrs);
echo strip_tags($fiyatkrs [0][0]);
echo "<br>";
}
}
?>