I am trying to parse the price from the site (at class="detail-price-uah" ), but it is not loaded for all the specified goods, that is, for some goods it is not loaded for others. And with each launch it changes, that is, now this product has loaded the price, restarted the parser, it already has no price, but it has another product.
As far as I understand, the price on the source site is loaded from a script, but <meta itemprop="price" content="399"> is nearby <meta itemprop="price" content="399"> Here the value of content="399" is the price I need, that is, "399".
But to get to this content I can not. How can I do that? Or how can I load the data directly from the script?
I saw that it seemed to be possible to stretch everything like a regular one, but I still don’t understand how to write it.
Maybe asking stupid questions, I'm just starting to learn it all.
My parser code is:
<?php header('Content-Type: text/html; charset=utf-8'); include_once('lib/curl_queri.php'); include_once('lib/simple_html_dom.php'); $html = curl_get('https://rozetka.com.ua/uslugi/c153670/'); //подключаюсь к сайту донору $dom = str_get_html($html); //получаю код страницы $services = $dom->find('.gi-tile-i-title'); //ищу на странице товары (сервисы) foreach($services as $service){ $a = $service->find('a', 0); //сохраняю ссылки на сервисы $one = curl_get($a->href); //перехожу на страницу по сохраненной ссылке $one_dom = str_get_html($one); //получаю код страницы $price = $one_dom->find('.detail-price-uah'); //ищу на странице цену по классу echo $price . ' --- ' . $a->href . '<br>'; //вывожу цены и ссылки на сервисы } ?>
"gi-tile-i-box-desc, got a link, then found inside thescripttag. inside dug up the linepricerawjson = '(.*?)', madeurl_decode, thenjson_decode, and tookprice- teran from it