scrapemax/scrapemax-php
最新稳定版本:0.0.6
Composer 安装命令:
composer require scrapemax/scrapemax-php
包简介
Scrapemax PHP API Client
README 文档
README
A PHP client for the Scrapemax API.
Installation
composer require scrapemax/scrapemax-php
Usage
require_once 'vendor/autoload.php'; use Scrapemax\ScrapemaxClient; // Instantiate the ScrapeClient with the API base URL and key $client = new ScrapemaxClient('https://api.scrapemax.com', 'your_api_key'); // Use the ScrapeClient to make API requests $response = $client->scrape([ 'js_enabled' => 1, 'target_url' => 'https://example.com/page', 'proxy' => 'premium', 'type' => 'data' ]); print_r($response);
Custom Guzzle Client
If you have specific requirements for your Guzzle client, you can use your own instance by passing it as the third parameter to the ScrapeClient constructor. Ensure that the custom client includes the 'base_uri' option to specify the API endpoint. Here's an example:
use GuzzleHttp\Client as GuzzleClient; use Scrapemax\ScrapemaxClient; // Instantiate a custom Guzzle client with additional configuration $customGuzzleClient = new GuzzleClient([ 'base_uri' => 'https://api.scrapemax.com', 'timeout' => 5, // Add any other Guzzle client options as needed ]); // Instantiate the ScrapeClient with the API base URL, key, and custom Guzzle client $client = new ScrapemaxClient('https://api.scrapemax.com', 'your_api_key', $customGuzzleClient); // Use the ScrapeClient to make API requests with the custom Guzzle client $response = $client->scrape([ 'js_enabled' => 1, 'target_url' => 'https://example.com/page', 'proxy' => 'premium', 'type' => 'data' ]); print_r($response);
统计信息
- 总下载量: 721
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-12-05