Search code examples
javascriptphphtmlhtmlelements

Web page to API : Make an API from HTML elements


Is it possible to retrive HTML elements, div for example, and make an API from it.

For example, I want to make an API from http://www.tvguide.com/listings/, and take the listings div, and make an API.

I mostly work in PHP, so a PHP answer should be nice (-:

Thanks


Solution

  • You can't create an API for a service that is not provided by yourself. What you want to do is extract some information from a webpage. This is called a scraper. Have a look at https://github.com/FriendsOfPHP/Goutte