yanthink / selenium
selenium
dev-master
2018-07-11 10:12 UTC
Requires
- php: >=7.1.0
- facebook/webdriver: ~1.3
This package is not auto-updated.
Last update: 2024-11-15 21:59:25 UTC
README
安装
- 打开终端执行下面命令:
composer require yanthink/selenium="@dev"
- 使用
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Yanthink\selenium\Browser; use Yanthink\selenium\Selenium; Selenium::useChromeDriver(); Selenium::enableAutoStartChromeDriver(); class Test extends Command { public function handle(Selenium $selenium) { $selenium->browse(function (Browser $browser) { $browser->visit('http://localhost/foo') ->waitFor('#pass') ->type('pass', 'password') ->click('#sub') ->dump(); }); } }