shahina/seocrawler

此包最新版本(dev-main)无可用许可证信息。

dev-main 2022-02-25 07:57 UTC

This package is not auto-updated.

Last update: 2024-09-20 21:52:43 UTC


README

Composer

通过命令行

$ composer require shahinaca/seocrawler

使用方法

  
  // Get a engine using parameter, options available are: "Google", "Yahoo", "Bing"
  $client = new SearchEngineCrawler("Google");
  
  // Set maximum amount of results to fetch (default: 100)
  $client->setMaxResults(30);
  
  // Set timeout between each request (default: 500)
  $client->setTimeout(200);
  
  // Set a header option (default: 
  $client->setHeader("User-Agent", "My awesome user agent/2.3");
  
  // Search results, $r is an array of CrawlerResult object with getTitle(), getDescription() and getUrl() operations
  $r = $client->search('madrid');