[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8345":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":21,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":31,"discoverSource":32},8345,"php-webdriver","php-webdriver\u002Fphp-webdriver","PHP client for Selenium\u002FWebDriver protocol. Previously facebook\u002Fphp-webdriver","",null,"PHP",5206,847,162,21,0,2,39.79,"MIT License",false,"main",true,[5,23,24,25,26,27],"selenium","selenium-php","selenium-webdriver","w3c-webdriver","webdriver","2026-06-12 02:01:52","# php-webdriver – Selenium WebDriver bindings for PHP\n\n[![Latest stable version](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fphp-webdriver\u002Fwebdriver.svg?style=flat-square&label=Packagist)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fphp-webdriver\u002Fwebdriver)\n[![GitHub Actions build status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fphp-webdriver\u002Fphp-webdriver\u002Ftests.yaml?style=flat-square&label=GitHub%20Actions)](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Factions)\n[![SauceLabs test status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fphp-webdriver\u002Fphp-webdriver\u002Fsauce-labs.yaml?style=flat-square&label=SauceLabs)](https:\u002F\u002Fsaucelabs.com\u002Fu\u002Fphp-webdriver)\n[![Total downloads](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdd\u002Fphp-webdriver\u002Fwebdriver.svg?style=flat-square&label=Downloads)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fphp-webdriver\u002Fwebdriver)\n\n## Description\nPhp-webdriver library is PHP language binding for Selenium WebDriver, which allows you to control web browsers from PHP.\n\nThis library is compatible with Selenium server version 2.x, 3.x and 4.x.\n\nThe library supports modern [W3C WebDriver](https:\u002F\u002Fw3c.github.io\u002Fwebdriver\u002F) protocol, as well\nas legacy [JsonWireProtocol](https:\u002F\u002Fwww.selenium.dev\u002Fdocumentation\u002Flegacy\u002Fjson_wire_protocol\u002F).\n\nThe concepts of this library are very similar to the \"official\" Java, JavaScript, .NET, Python and Ruby libraries\nwhich are developed as part of the [Selenium project](https:\u002F\u002Fgithub.com\u002FSeleniumHQ\u002Fselenium\u002F).\n\n## Installation\n\nInstallation is possible using [Composer](https:\u002F\u002Fgetcomposer.org\u002F).\n\nIf you don't already use Composer, you can download the `composer.phar` binary:\n\n    curl -sS https:\u002F\u002Fgetcomposer.org\u002Finstaller | php\n\nThen install the library:\n\n    php composer.phar require php-webdriver\u002Fwebdriver\n\n## Upgrade from version \u003C1.8.0\n\nStarting from version 1.8.0, the project has been renamed from `facebook\u002Fphp-webdriver` to `php-webdriver\u002Fwebdriver`.\n\nIn order to receive the new version and future updates, **you need to rename it in your composer.json**:\n\n```diff\n\"require\": {\n-    \"facebook\u002Fwebdriver\": \"(version you use)\",\n+    \"php-webdriver\u002Fwebdriver\": \"(version you use)\",\n}\n```\n\nand run `composer update`.\n\n## Getting started\n\n### 1. Start server (aka. remote end)\n\nTo control a browser, you need to start a *remote end* (server), which will listen to the commands sent\nfrom this library and will execute them in the respective browser.\n\nThis could be Selenium standalone server, but for local development, you can send them directly to so-called \"browser driver\" like Chromedriver or Geckodriver.\n\n#### a) Chromedriver\n\n📙 Below you will find a simple example. Make sure to read our wiki for [more information on Chrome\u002FChromedriver](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FChrome).\n\nInstall the latest Chrome and [Chromedriver](https:\u002F\u002Fsites.google.com\u002Fchromium.org\u002Fdriver\u002Fdownloads).\nMake sure to have a compatible version of Chromedriver and Chrome!\n\nRun `chromedriver` binary, you can pass `port` argument, so that it listens on port 4444:\n\n```sh\nchromedriver --port=4444\n```\n\n#### b) Geckodriver\n\n📙 Below you will find a simple example. Make sure to read our wiki for [more information on Firefox\u002FGeckodriver](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FFirefox).\n\nInstall the latest Firefox and [Geckodriver](https:\u002F\u002Fgithub.com\u002Fmozilla\u002Fgeckodriver\u002Freleases).\nMake sure to have a compatible version of Geckodriver and Firefox!\n\nRun `geckodriver` binary (it start to listen on port 4444 by default):\n\n```sh\ngeckodriver\n```\n\n#### c) Selenium standalone server\n\nSelenium server can be useful when you need to execute multiple tests at once,\nwhen you run tests in several different browsers (like on your CI server), or when you need to distribute tests amongst\nseveral machines in grid mode (where one Selenium server acts as a hub, and others connect to it as nodes).\n\nSelenium server then act like a proxy and takes care of distributing commands to the respective nodes.\n\nThe latest version can be found on the [Selenium download page](https:\u002F\u002Fwww.selenium.dev\u002Fdownloads\u002F).\n\n📙 You can find [further Selenium server information](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FSelenium-server)\nin our wiki.\n\n#### d) Docker\n\nSelenium server could also be started inside Docker container - see [docker-selenium project](https:\u002F\u002Fgithub.com\u002FSeleniumHQ\u002Fdocker-selenium).\n\n### 2. Create a Browser Session\n\nWhen creating a browser session, be sure to pass the url of your running server.\n\nFor example:\n\n```php\n\u002F\u002F Chromedriver (if started using --port=4444 as above)\n$serverUrl = 'http:\u002F\u002Flocalhost:4444';\n\u002F\u002F Geckodriver\n$serverUrl = 'http:\u002F\u002Flocalhost:4444';\n\u002F\u002F selenium-server-standalone-#.jar (version 2.x or 3.x)\n$serverUrl = 'http:\u002F\u002Flocalhost:4444\u002Fwd\u002Fhub';\n\u002F\u002F selenium-server-standalone-#.jar (version 4.x)\n$serverUrl = 'http:\u002F\u002Flocalhost:4444';\n```\n\nNow you can start browser of your choice:\n\n```php\nuse Facebook\\WebDriver\\Remote\\RemoteWebDriver;\n\n\u002F\u002F Chrome\n$driver = RemoteWebDriver::create($serverUrl, DesiredCapabilities::chrome());\n\u002F\u002F Firefox\n$driver = RemoteWebDriver::create($serverUrl, DesiredCapabilities::firefox());\n\u002F\u002F Microsoft Edge\n$driver = RemoteWebDriver::create($serverUrl, DesiredCapabilities::microsoftEdge());\n```\n\n### 3. Customize Desired Capabilities\n\nDesired capabilities define properties of the browser you are about to start.\n\nThey can be customized:\n\n```php\nuse Facebook\\WebDriver\\Firefox\\FirefoxOptions;\nuse Facebook\\WebDriver\\Remote\\DesiredCapabilities;\n\n$desiredCapabilities = DesiredCapabilities::firefox();\n\n\u002F\u002F Disable accepting SSL certificates\n$desiredCapabilities->setCapability('acceptSslCerts', false);\n\n\u002F\u002F Add arguments via FirefoxOptions to start headless firefox\n$firefoxOptions = new FirefoxOptions();\n$firefoxOptions->addArguments(['-headless']);\n$desiredCapabilities->setCapability(FirefoxOptions::CAPABILITY, $firefoxOptions);\n\n$driver = RemoteWebDriver::create($serverUrl, $desiredCapabilities);\n```\n\nCapabilities can also be used to [📙 configure a proxy server](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FHowTo-Work-with-proxy) which the browser should use.\n\nTo configure browser-specific capabilities, you may use [📙 ChromeOptions](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FChrome#chromeoptions)\nor [📙 FirefoxOptions](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FFirefox#firefoxoptions).\n\n* See [legacy JsonWire protocol](https:\u002F\u002Fgithub.com\u002FSeleniumHQ\u002Fselenium\u002Fwiki\u002FDesiredCapabilities) documentation or [W3C WebDriver specification](https:\u002F\u002Fw3c.github.io\u002Fwebdriver\u002F#capabilities) for more details.\n\n### 4. Control your browser\n\n```php\n\u002F\u002F Go to URL\n$driver->get('https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSelenium_(software)');\n\n\u002F\u002F Find search element by its id, write 'PHP' inside and submit\n$driver->findElement(WebDriverBy::id('searchInput')) \u002F\u002F find search input element\n    ->sendKeys('PHP') \u002F\u002F fill the search box\n    ->submit(); \u002F\u002F submit the whole form\n\n\u002F\u002F Find element of 'History' item in menu by its css selector\n$historyButton = $driver->findElement(\n    WebDriverBy::cssSelector('#ca-history a')\n);\n\u002F\u002F Read text of the element and print it to output\necho 'About to click to a button with text: ' . $historyButton->getText();\n\n\u002F\u002F Click the element to navigate to revision history page\n$historyButton->click();\n\n\u002F\u002F Make sure to always call quit() at the end to terminate the browser session\n$driver->quit();\n```\n\nSee [example.php](example.php) for full example scenario.\nVisit our GitHub wiki for [📙 php-webdriver command reference](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki\u002FExample-command-reference) and further examples.\n\n**NOTE:** Above snippets are not intended to be a working example by simply copy-pasting. See [example.php](example.php) for a working example.\n\n## Changelog\nFor latest changes see [CHANGELOG.md](CHANGELOG.md) file.\n\n## More information\n\nSome basic usage example is provided in [example.php](example.php) file.\n\nHow-tos are provided right here in [📙 our GitHub wiki](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki).\n\nIf you don't use IDE, you may use [API documentation of php-webdriver](https:\u002F\u002Fphp-webdriver.github.io\u002Fphp-webdriver\u002Flatest\u002F).\n\nYou may also want to check out the Selenium project [docs](https:\u002F\u002Fselenium.dev\u002Fdocumentation\u002Fen\u002F) and [wiki](https:\u002F\u002Fgithub.com\u002FSeleniumHQ\u002Fselenium\u002Fwiki).\n\n## Testing framework integration\n\nTo take advantage of automatized testing you may want to integrate php-webdriver to your testing framework.\nThere are some projects already providing this:\n\n- [Symfony Panther](https:\u002F\u002Fgithub.com\u002Fsymfony\u002Fpanther) uses php-webdriver and integrates with PHPUnit using `PantherTestCase`\n- [Laravel Dusk](https:\u002F\u002Flaravel.com\u002Fdocs\u002Fdusk) is another project using php-webdriver, could be used for testing via `DuskTestCase`\n- [Steward](https:\u002F\u002Fgithub.com\u002Flmc-eu\u002Fsteward) integrates php-webdriver directly to [PHPUnit](https:\u002F\u002Fphpunit.de\u002F), and provides parallelization\n- [Codeception](https:\u002F\u002Fcodeception.com\u002F) testing framework provides BDD-layer on top of php-webdriver in its [WebDriver module](https:\u002F\u002Fcodeception.com\u002Fdocs\u002Fmodules\u002FWebDriver)\n- You can also check out this [blogpost](https:\u002F\u002Fcodeception.com\u002F11-12-2013\u002Fworking-with-phpunit-and-selenium-webdriver.html) + [demo project](https:\u002F\u002Fgithub.com\u002FDavertMik\u002Fphp-webdriver-demo), describing simple [PHPUnit](https:\u002F\u002Fphpunit.de\u002F) integration\n\n## Support\n\nWe have a great community willing to help you!\n\n❓ Do you have a **question, idea or some general feedback**? Visit our [Discussions](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fdiscussions) page.\n(Alternatively, you can [look for many answered questions also on StackOverflow](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fphp+selenium-webdriver)).\n\n🐛 Something isn't working, and you want to **report a bug**? [Submit it here](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fissues\u002Fnew) as a new issue.\n\n📙 Looking for a **how-to** or **reference documentation**? See [our wiki](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fwiki).\n\n## Contributing ❤️\n\nWe love to have your help to make php-webdriver better. See [CONTRIBUTING.md](.github\u002FCONTRIBUTING.md) for more information about contributing and developing php-webdriver.\n\nPhp-webdriver is community project - if you want to join the effort with maintaining and developing this library, the best is to look on [issues marked with \"help wanted\"](https:\u002F\u002Fgithub.com\u002Fphp-webdriver\u002Fphp-webdriver\u002Fissues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)\nlabel. Let us know in the issue comments if you want to contribute and if you want any guidance, and we will be delighted to help you to prepare your pull request.\n","php-webdriver 是一个用于 Selenium\u002FWebDriver 协议的 PHP 客户端库，允许用户通过 PHP 代码控制网页浏览器。该项目支持 Selenium 服务器版本 2.x、3.x 和 4.x，并兼容现代 W3C WebDriver 协议及旧版 JsonWireProtocol。其设计理念与 Selenium 项目官方提供的 Java、JavaScript、.NET、Python 和 Ruby 库相似。适合于需要在 PHP 环境下进行自动化测试或网页操作的场景，如网站功能测试、爬虫开发等。安装过程简单，可通过 Composer 包管理器轻松完成。","2026-06-11 03:17:27","top_language"]