PHP code example of wxm / venomancer

1. Go to this page and download the library: Download wxm/venomancer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wxm / venomancer example snippets




= new \Wxm\Venomancer\Application();

$app->server->serve();

// php ./server.php
// 如果不存在 chromium 根据提示下载 chromium 然后编辑配置,没有提示则不用管这部分,然后再次执行启动服务
// vim .env
// CHROMIUM_EXECUTABLE_PATH=这里填可执行地址



= new \Wxm\Venomancer\Application();

$image = $app->clinet->screenshot('http://baidu.com');

file_put_contents('./baidu.png', $image);

// php ./client.php