I need to extract the value of last status from one page of delivery courrier, when I make the request sending the tracking number. I already found some useful information, but I don't know if is possible with php extract only some value from the result page.
This is the link:
https://www.sda.it/SITO_SDA-WEB/dispatcherHol?execute2=ActionTracking.doGetSpedizioneSelfTrck&id_cliente=000000000000&id_ldv=3872809279719
Endpoint: https://www.sda.it
Resource: /SITO_SDA-WEB/dispatcherHol
Parameters: execute2 : ActionTracking.doGetSpedizioneSelfTrck
id_cliente : 000000000000
id_ldv : 3872809279719
I don't know how to extract into one variable only the result of the first line:
<td class="rowheadBis" align="center" colspan="3">Spedizione n: 3872809279719 - IN CONSEGNA</td>
Use CURL
or file_get_contents()
to get the HTML from the page. Then search it with Xpath
.
For details see https://www.php.net/manual/en/class.domxpath.php and https://www.php.net/manual/en/function.file-get-contents.php OR https://www.php.net/manual/en/book.curl.php