wxm / venomancer
venomancer for php
Installs: 16
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 8
Language:JavaScript
Requires
- php: >=7.1.3
- guzzlehttp/guzzle: ^6.2
- monolog/monolog: ^1.22 || ^2.0
- pimple/pimple: ^3.0
- symfony/http-foundation: ^2.7 || ^3.0 || ^4.0 || ^5.0
- symfony/process: ^2.3|^3.0|^4.0|^5.0
- wxm/sdk-kernel: v1.2.2
- dev-master
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.1
- v1.0.0
- v0.1.0
- v0.0.8
- v0.0.7
- dev-dependabot/npm_and_yarn/minimist-and-minimist-and-mkdirp-and-handlebars-1.2.8
- dev-dependabot/npm_and_yarn/http-cache-semantics-and-lerna-4.1.1
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/packages/venomancer/qs-6.11.0
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/packages/venomancer/browser/minimatch-3.1.2
- dev-dependabot/npm_and_yarn/thenify-3.3.1
- dev-dependabot/npm_and_yarn/packages/venomancer/urijs-1.19.11
This package is auto-updated.
Last update: 2024-10-30 01:53:54 UTC
README
Node.js 下的 API 服务(可单独使用), 加 PHP 套件.
- 基于 puppeteer 的 headless-chrome 能力封装及性能优化
- 支持 html 渲染生成图片
- 支持 url 访问生成图片
- TODO 其他 headless-chrome 能力
- TODO 其他 API
快速开始
npm install venomancer --save
Node.js 下单独使用
# 启动服务 venomancer --port=8888 # 如果不存在 chromium 根据提示下载 chromium 然后编辑配置,没有提示则不用管这部分,然后再次执行启动服务 vim .env CHROMIUM_EXECUTABLE_PATH=这里填可执行地址
Node.js 服务下的 RESTful API 列表
截图
# POST # content = url http://localhost:8888/screenshot?content=https://baidu.com&scroll=1&fullPage=1 # content = html http://localhost:8888/screenshot?content=<h1>213123</h1>&scroll=1&fullPage=1
PHP 套件
composer require wxm/venomancer
server.php
<?php require './vendor/autoload.php'; $app = new \Wxm\Venomancer\Application(); $app->server->serve(); // php ./server.php // 如果不存在 chromium 根据提示下载 chromium 然后编辑配置,没有提示则不用管这部分,然后再次执行启动服务 // vim .env // CHROMIUM_EXECUTABLE_PATH=这里填可执行地址
client.php
<?php require './vendor/autoload.php'; $app = new \Wxm\Venomancer\Application(); $image = $app->clinet->screenshot('http://baidu.com'); file_put_contents('./baidu.png', $image); // php ./client.php
参考
License
The MIT License (MIT). Please see License File for more information.