vendredi 21 juillet 2017

Php Scraping - How do I catch the variable in the source code?

In the following html code, I want to catch the variable "1.31". Thank you for your help already.

Source Code
    <div style="font-size:20px">1.31 <i class="fa fa-try"></i> <span style="text-decoration: line-through; color:#919191; font-size: 14px; margin-top: 7px; margin-right: 5px; float:left" itemprop="price" content="1.55">1.55 <i class="fa fa-try" itemprop="priceCurrency" content="TL"></i></span>
    <link itemprop="availability" href="http://ift.tt/Yc7eML">
    </div>

<?php

$url = "http://ift.tt/2txJMpw";

$url_connect = file_get_contents($url);

preg_match_all('@<div style="font-size:20px">(.*?)<i@si',$url_connect,$results);

print_r($results);

?>




Aucun commentaire:

Enregistrer un commentaire