PHP code example of lhpires / correios-rastreamento

1. Go to this page and download the library: Download lhpires/correios-rastreamento library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lhpires / correios-rastreamento example snippets




$ProcessaCrawler = new ProcessaCrawler();
$domc = new Crawler();
$content = file_get_contents("https://www.linkcorreios.com.br/{$seu_codigo}");

$filtro = ".linha_status";

$ProcessaCrawler::htmlToJson($content,$filtro,$domc);