定制 cfv1000/phantomjs-cloud 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

cfv1000/phantomjs-cloud

Composer 安装命令:

composer require cfv1000/phantomjs-cloud

包简介

PhantomJS Cloud API wrapper

README 文档

README

A library to interact with the Phantom JS Cloud

Examples and extensive documentation on the API https://phantomjscloud.com/docs/http-api/

Simple example

Write the web page to a JPG file:

include_once 'vendor/autoload.php';

$request = new \PhantomJS\PageRequest('http://www.example.com');
file_put_contents('example.com.jpg', $request->getResponse());

This example shouldn't be used in production. If you need to perform advanced HTTP requests to the api, please address a dedicated library for that. This library should be used only to write your requests

Guzzle Example

include_once __DIR__ . '/vendor/autoload.php';

/**
 * write your phantom js request
 * @see https://phantomjscloud.com/docs/
 */
$request = new \PhantomJS\PageRequest('http://www.example.com');

/**
 * Initialize Guzzle to perform HTTP requests
 * @see http://docs.guzzlephp.org/en/stable
 * The request url will be https://phantomjscloud.com/api/browser/v2/a-demo-key-with-low-quota-per-ip-address/?request={url:%22http://www.example.com%22}
 */
$client = new GuzzleHttp\Client();
$response = $client->get($request->getApiUrl() . '?request=' . $request->toJSON());
print $response->getBody();

TODO - What we plan next for this code

  • have a directory structure that will allow you to separate PhantomJS classes from helper classes
  • migrate public arguments to protected arguments where possible and use setters and getters.
  • see TODO's in the class comments
  • add examples in the documentation

统计信息

  • 总下载量: 189
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固