first of all I know that there are many topics about this, but I did not find a solution in any of them. My problem is the following, I want to extract with php using "file_get_contents" 2 data from a site that have the same name in the div. I need to extract the data and then assign each one a certain variable with PHP. Anyway, here is the code snippet that does NOT return anything.
$htmlOficial = file_get_contents('https://www.dolarhoy.com/cotizaciondolaroficial');
preg_match('/<tr><td><a href="#">Banco Nacion</a></td><td class="number">(.*)</td>/',
$htmlOficial, $ventaOficial);
preg_match('/<tr><td><a href="#">Banco Nacion</a></td><td class="number"></td> <td class="number">(.*)</td>
</tr>/',
$htmlOficial, $compraOficial);
$ventaOficial = $ventaOficial[1];
$compraOficial = $compraOficial[1];
The site is https://www.dolarhoy.com/cotizaciondolaroficial, In the "entities" box it says "Banco Nacion". I need to extract the data of "buy" on the one hand and "sale" on the other