-1
I am making a Web Scraping in PHP to get the auction lot information from this site https://www.sold.com.br/ I need to capture the information in an Array. But the array is not bringing the information in the order I want. He’s bringing in all the dates, then all the assets, the types and the descriptions. I need it to group in the DATA, WELL, TYPE and DESCRIPTION array in the same index, only to then go to the next index of the array.
<?php
require_once "simple_html_dom.php";
$url = 'https://www.sold.com.br/';
$hold = array();
$html = file_get_html($url);
$i = 0;
if(!empty($html)) {
$element = $data = "";
foreach ($html->find(".container-fluid") as $element) {
foreach($element -> find(".data")as $data){
$hold[]["Data"] = trim($data->plaintext);
}
foreach($element -> find(".leilao-tipo-bem")as $tipoBem){
$hold[]["Bem"] = trim($tipoBem->plaintext);
}
foreach($element -> find(".tipo")as $tipo){
$hold[]["Tipo"] = trim($tipo->plaintext);
}
foreach($element -> find(".leilao-descricao")as $descricao){
$hold[]["Descricao"] = trim($descricao->plaintext);
}
$i++;
}
}
print_r($hold);
?>