bewil19 / php-undected-webdriver
一个 composer php 未检测的 webdriver。
v0.0.1
2022-05-31 19:44 UTC
Requires
- php: ^8.0
- ext-zip: *
- php-webdriver/webdriver: ^1.12
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- phpunit/phpunit: ^9.4
Suggests
- ext-gmp: For Permissions and 64 bit calculations on x86 (32 bit) PHP.
This package is auto-updated.
Last update: 2024-09-04 11:20:30 UTC
README
开始之前
在您开始使用这个库之前,您需要了解 PHP 的工作原理,您需要了解这门语言。
常见问题解答
待办事项
入门
需求
- PHP 8
- 我们推荐使用 PHP 8.0,因为它将是最稳定和性能最好的。
- 32位 x86 PHP 需要
ext-gmp
扩展 以处理权限。
- Composer
Windows 和 SSL
不幸的是,Windows 上的 PHP 无法访问 Windows 证书存储。这是一个问题,因为 TLS 被使用,因此证书验证被应用(关闭这不是一个选项)。
您将通过脚本在没有任何错误的情况下立即退出一个循环来注意到这个问题。不幸的是,没有错误或异常。
因此,使用这个库的用户需要从 cURL 网站下载一个 证书颁发机构提取。
必须将 caextract 的路径设置在 php.ini
的 openssl.cafile
中。
推荐扩展
- 最新的 PHP 版本。
- 如果使用 32 位 PHP,则需要
ext-gmp
。
安装
使用 Composer 安装。
- 运行
composer require bewil19/php-undected-webdriver
。这将安装最新版本。- 如果您愿意,您也可以通过运行
composer require bewil19/php-undected-webdriver dev-master
安装开发分支。
- 如果您愿意,您也可以通过运行
- 在主文件顶部包含 Composer 自动加载文件
include __DIR__.'/vendor/autoload.php';
基本示例
<?php use UndectedWebdriver\Chrome; require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; $example = new Chrome(); $sites = [ 'https://nowsecure.nl', 'https://bot.sannysoft.com/', ]; $example = new $browser(); foreach ($sites as $site) { $example->get($site); $a = 0; while ($a <= 10) { sleep(5); ++$a; } } $example->driver()->close();
有关更多信息,请参阅 示例文件夹。
文档
待办事项
贡献
我们欢迎贡献。但是,请确保您遵循我们的编码标准(PSR-4 自动加载和自定义样式)。请在提交拉取请求之前运行 composer run-script cs
以运行 php-cs-fixer。
许可
MIT 许可证,© Be Wilson 和其他贡献者 2022 年至今。