3
I am making a "technical resource" to be able to return the status of the SEFAZ servers of issuing tax notes using PHP. For this, I have until now 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 provides without need of digital certificate to see the status of the servers.
I need to know how I can get only an existing HTML element inside the variable $d
(the element is the table.tabelaListagemDados
) and from his values I can do treatments.
I know 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 then I can return only one JSON and not a whole page.
Someone sees a solution on how I can do to only get this element inside the page?
These links should help: http://answall.com/questions/44694/capturr-e-filtrar-result, http://answall.com/questions/78621/comoros-extrair-data
– bfavaretto
For sure @bfavaretto! They helped me a lot! gave work but ta there the library (if you need the link ta in the question)
– LeandroLuk