承接 scrapemax/scrapemax-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-12-05