Web scraping in PHP

后端 未结 5 877
梦毁少年i
梦毁少年i 2020-11-27 14:48

I\'m looking for a way to make a small preview of another page from a URL given by the user in PHP.

I\'d like to retrieve only the title of the page, an image (like

5条回答
  •  感情败类
    2020-11-27 15:08

    You may use either of these libraries. As you know each one has pros & cons, so you may consult notes about each one or take time & try it on your own:

    • Guzzle: An Independent HTTP client, so no need to depend on cURL, SOAP or REST.
    • Goutte: Built on Guzzle & some of Symfony components by Symfony developer.
    • hQuery: A fast scraper with caching capabilities. high performance on scraping large docs.
    • Requests: Famous for its user-friendly usage.
    • Buzz: A lightweight client, ideal for beginners.
    • ReactPHP: Async scraper, with comprehensive tutorials & examples.

    You'd better check them all & use everyone in its best intended occasion.

提交回复
热议问题