0

I am trying to hit the courier companies website from Controller ( e.g bluedart,fedex etc) by passing the courier tracking number and fetch status of the given tracking number.

I am using $HttpSocket->get/post to hit the webpage URL

I am able to display the response body

How can I fetch the data from the response.

Or is there any other way to achieve the same

Please help me out .

Rahul
  • 3,479
  • 3
  • 16
  • 28

1 Answers1

0

How can I fetch the data from the response.

Parse the result, either using regular expressions or the DOMDocument class and traverse it. See Parsing HTML in Cakephp as well.

Or is there any other way to achieve the same

Use the APIs these companies usually offer.

Community
  • 1
  • 1
floriank
  • 25,546
  • 9
  • 42
  • 66