shimabox/selenium-downloader
Composer 安装命令:
composer require shimabox/selenium-downloader
包简介
selenium-server-standalone, ChromeDriver, geckodriver and IEDriverServer downloader.
README 文档
README
selenium-server-standalone, ChromeDriver, geckodriver and IEDriverServer downloader.
Features
- Can download selenium related assets interactively or with option(not interactive).
- Selectable from Mac, Windows, Linux.
Demo
Interactively.
With option (not interactive).
Requirements
- PHP 5.5+ or newer
Installation
Via Composer
$ composer require shimabox/selenium-downloader
Please refer to the link below.
##instant-download
Develop
$ git clone https://github.com/shimabox/selenium-downloader
$ cd selenium-downloader
$ composer install
Setting(.env)
If you need to change the default settings, copy the .env.default file, create an .env file, and modify the .env file.
The default setting looks at .env.default file.
$ cp .env.dafault .env
$ vim .env
// The default of output directory path(Output to "selenium-downloader/xxx" if not set).
DEFAULT_OUTPUT_DIR=
// The default version of selenium-server-standalone.
// Why 3.8.1? Because there are cases where it will not work unless pass-through mode can be set to false(-enablePassThrough false).
DEFAULT_SELENIUM_VER='3.8.1'
// The default version of ChromeDriver.
DEFAULT_CHROMEDRIVER_VER='81.0.4044.69'
// The default version of geckodriver.
DEFAULT_GECKODRIVER_VER='0.26.0'
// The default version of IEDriverServer.
DEFAULT_IEDRIVER_VER='3.141.59'
If DEFAULT_OUTPUT_DIR is not set, the downloaded asset is output to selenium-downloader/xxx.
Usage
In the case of interactive mode.
# Run without option.
$ php selenium_downloader.php
e.g)
# "m" or "w" or "l" is mandatory.
Please select platform. [m]ac, [w]indows, [l]inux: w
# Specify the directory path to output.
# If not specified, it is output to the path specified by .env.dafault|.env(DEFAULT_OUTPUT_DIR).
# If there is still no value, it is output to "selenium-downloader/xxx".
Please enter the output directory
Default[/default/output/path]:
# Default "No".
Do you need Selenium? [N]o, [y]es: y
# Default "3.8.1".
# Why 3.8.1? Because there are cases where it will not work unless pass-through mode can be set to false(-enablePassThrough false).
Please enter selenium-server-standalone version Default [3.8.1]: 3.8.1
# Default "No".
Do you need ChromeDriver? [N]o, [y]es: y
# Default "81.0.4044.69".
Please enter ChromeDriver version Default [81.0.4044.69]:
# Default "No".
Do you need GeckoDriver? [N]o, [y]es: y
# Default "0.26.0".
Please enter GeckoDriver version Default [0.26.0]:
# Default "No".
Do you need IEDriver? [N]o, [y]es: y
# Default "3.141.59".
Please enter IEDriver version Default [3.141.59]:
# Default "32" (Because key input is earlier than 64bit version).
Please enter OS bit version [32]bit, [64]bit, Default[32]:
Done.
When specifying options (not interactive).
Supports the following options.
| Format | Description |
|---|---|
| -h,--help | Display help message and exit. |
| -p | Select platform [m]ac or [w]indows or [l]inux. Required except that "-h, --help" is specified. |
| -d | Specify the directory path to output. If not specified, it is output to the path specified by .env.dafault|.env(DEFAULT_OUTPUT_DIR). If there is still no value, it is output to "selenium-downloader/xxx". |
| -s | The version of selenium-standalone-server. (e.g 3.8.1, 3.7(3.7.0) (Recommend version 3.8.1) |
| -c | The version of ChromeDriver. (e.g 81.0.4044.69, 2.43 |
| -g | The version of GeckoDriver. (e.g 0.26(0.26.0), 0.20.1 |
| -i | The version of IEDriverServer. (e.g 3.141.59, 3.14(3.14.0) |
| -b | The number of OS bits (32 or 64). Default is "32" (Because key input is earlier than 64bit version) Valid only when IEDriverServer is specified. |
Help message.
$ php selenium_downloader.php -h
Usage:
-h,--help
Display help message and exit.
-p platform (required)
Select platform [m]ac or [w]indows or [l]inux.
Required except that "--help, -h" is specified.
-d output_dir_path
Enter the output directory path.
If not specified, it is output to the path specified by .env.dafault|.env(DEFAULT_OUTPUT_DIR).
If there is still no value, it is output to "selenium-downloader/xxx".
-s selenium-standalone-server_ver
Enter the version of selenium-standalone-server. (e.g 3.8.1, 3.7(3.7.0)
(Recommend version 3.8.1)
-c ChromeDriver_ver
Enter the version of ChromeDriver. (e.g 81.0.4044.69, 2.43
-g geckodriver_ver
Enter the version of GeckoDriver. (e.g 0.26(0.26.0), 0.20.1
-i IEDriverServer_ver
Enter the version of IEDriverServer. (e.g 3.141.59, 3.14(3.14.0)
-b bit_of_os
Enter the number of OS bits (32 or 64).
Default is "32" (Because key input is earlier than 64bit version).
Valid only when IEDriverServer is specified.
e.g) 1 Basic.
$ php selenium_downloader.php -p m -s 3.8.1 -c 81.0.4044.69 -g 0.26
e.g) 2 When specifying the output directory.
$ php selenium_downloader.php -p m -d /your/path/to -s 3.8.1
e.g) 3 When downloading the 64 bit version of the IEDriverServer.
$ php selenium_downloader.php -p w -i 3.141.59 -b 64
e.g) 4 When downloading only geckodriver.
$ php selenium_downloader.php -p m -g 0.26
or
$ php selenium_downloader.php -p m -s "" -c "" -g 0.26
Instant download
For example, create instant_selenium.php.
<?php require_once 'vendor/autoload.php'; use SMB\SeleniumDownloader\Downloader; // Interface use SMB\SeleniumDownloader\Argument\Optionable; // Prepare a class that implements the optionable interface. class InstantSelenium implements Optionable { /** * Returns true if option is specified. * * @return boolean */ public function isSpecified() { return true; } /** * If true it will output a help message. * * @return boolean */ public function isSpecifiedHelp() { return false; } /** * Create help message. * * @return string */ public function createHelpMessage() { return ''; } /** * Get optional arguments. * * e.g) * <code> * return [ * 'p' => 'w', // Select platform [m]ac or [w]indows or [l]inux. * 'd' => '.', // Enter the output directory path. * 's' => '3.8.1', // Enter the version of selenium-standalone-server. (e.g 3.8.1, 3.7(3.7.0) * 'c' => '81.0.4044.69', // Enter the version of ChromeDriver. (e.g 81.0.4044.69, 2.43 * 'g' => '0.26.0', // Enter the version of GeckoDriver. (e.g 0.26(0.26.0), 0.20.1 * 'i' => '3.141.59', // Enter the version of IEDriverServer. (e.g 3.141.59, 3.14(3.14.0) * 'b' => '32', // Enter the number of OS bits (32 or 64). * ]; * </code> * * @return array */ public function get() { return [ 'p' => 'm', // Select mac. 's' => '3.8.1', 'c' => '81.0.4044.69', 'g' => '0.26.0', ]; } } $downloader = new Downloader(new InstantSelenium()); $downloader->execute();
Execute
$ php instant_selenium.php
Note
If there is one with the same name, it will be overwritten.
License
The MIT License (MIT). Please see License File for more information.
shimabox/selenium-downloader 适用场景与选型建议
shimabox/selenium-downloader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.23k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 10 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「selenium」 「download」 「downloader」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 shimabox/selenium-downloader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shimabox/selenium-downloader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 shimabox/selenium-downloader 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The NzoFileDownloaderBundle is a Symfony Bundle used to Download all types of files from servers and Web applications safely and with ease. You can also read/show the file content in the Web Browser.
Adds a download link next to assets
PHP powered alternative for youtube-dl
Utility for downloading Microsoft Edge Driver binary with browser version detection
Selenium4 (WebDriver) driver for Mink framework
Downloader Library
统计信息
- 总下载量: 2.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-31


