I am making a "technical resource" to be able to return the status of the SEFAZ servers issuing invoices using PHP. For this, I have so far the code below:
function get_content($URL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$d = get_content('http://www.nfe.fazenda.gov.br/portal/disponibilidade.aspx');
echo $d;
This code returns me the page that the recipe makes available without needing a digital certificate to see the status of the servers.
I need to know how I can do to get only an existing HTML element within the $d
variable (the element is table.tabelaListagemDados
) and from its values I can do treatments.
I know that I can handle this information using javascript (pure, with AngularJS or with jQuery) but if there is any method through PHP it is better because I can return only one JSON and not a whole page. >
Does anyone see a solution on how I can do to get only this element within the page?