Answer the question
In order to leave comments, you need to log in
How to pull out the right elements?
The question is how to pull out the elements correctly, for example, I need to pull the price from the page
/*
часть исходного кода
<span id="priceblock_dealprice" class="a-size-medium a-color-price priceBlockDealPriceString">13,49 €</span>
*/
... curl_multi_init()...
foreach($channels as $url=>$ch){
$content=trim(curl_multi_getcontent($ch));
if(preg_match("/\<span id\=\"priceblock\_dealprice\"/i",$content)){
$a=explode('<span id="priceblock_dealprice"',$content);
$a2=explode('</span>',$a[1]);
$a3=explode('>',$a2[0]);
$price=trim(strip_tags($a3[1]));
$a=explode(' ',$price);
$cost=$a[0];
echo $cost;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question