PHPackages                             dunglas/panthere - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. dunglas/panthere

Abandoned → [symfony/panther](/?search=symfony%2Fpanther)Library[Testing &amp; Quality](/categories/testing)

dunglas/panthere
================

A browser testing and web scraping library for PHP and Symfony.

37.0kPHP

Since Apr 9Pushed 5mo agoCompare

[ Source](https://github.com/dunglas/panthere)[ Packagist](https://packagist.org/packages/dunglas/panthere)[ RSS](/packages/dunglas-panthere/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (11)Used By (0)

[![Panther](panther.png)](panther.png)
======================================

[](#)

**A browser testing and web scraping library for [PHP](https://php.net) and [Symfony](https://symfony.com)**

[![Build Status](https://camo.githubusercontent.com/780d79479c3141a6c297daf9a125e64cc117ca9163f49e92bf8dff4831c98458/68747470733a2f2f7472617669732d63692e6f72672f73796d666f6e792f70616e746865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/symfony/panther)[![Build status](https://camo.githubusercontent.com/d9e7f786f7892bb0920f189cdfaf6e566e3e116ea97deefef81d1017c7660732/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f62756e6f633475667564346f696534353f7376673d74727565)](https://ci.appveyor.com/project/fabpot/panther)[![SensioLabsInsight](https://camo.githubusercontent.com/856b1e2fe6654784427f448ce787d5287305377ea18d7d0e07261967c9cb5cc5/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39656137653738632d393938612d343438392d393831352d3734343963653832393165662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/9ea7e78c-998a-4489-9815-7449ce8291ef)

*Panther* is a convenient standalone library to scrape websites and to run end-to-end tests **using real browsers**.

Panther is super powerful. It leverages [the W3C's WebDriver protocol](https://www.w3.org/TR/webdriver/) to drive native web browsers such as Google Chrome and Firefox.

Panther is very easy to use, because it implements Symfony's popular [BrowserKit](https://symfony.com/doc/current/components/browser_kit.html) and [DomCrawler](https://symfony.com/doc/current/components/dom_crawler.html) APIs, and contains all the features you need to test your apps. It will sound familiar if you have ever created [a functional test for a Symfony app](https://symfony.com/doc/current/testing.html#functional-tests): as the API is exactly the same! Keep in mind that Panther can be used in every PHP project, as it is a standalone library.

Panther automatically finds your local installation of Chrome and launches it (thanks to [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/)), so you don't need to install anything on your computer, neither Selenium server nor any other obscure driver.

In test mode, Panther automatically starts your application using [the PHP built-in web-server](http://php.net/manual/en/features.commandline.webserver.php). You can focus on writing your tests or web-scraping scenario and Panther will take care of everything else.

Features
--------

[](#features)

Unlike testing and web scraping libraries you're used to, Panther:

- executes the JavaScript code contained in webpages
- supports everything that Chrome (or Firefox) implements
- allows screenshots taking
- can wait for asynchronously loaded elements to show up
- lets you run your own JS code or XPath queries in the context of the loaded page
- supports custom [Selenium server](https://www.seleniumhq.org) installations
- supports remote browser testing services including [SauceLabs](https://saucelabs.com/) and [BrowserStack](https://www.browserstack.com/)

Documentation
-------------

[](#documentation)

### Install

[](#install)

Use [Composer](https://getcomposer.org/) to install Panther in your project. You may want to use the `--dev` flag if you want to use Panther for testing only and not for web scraping in a production environment:

```
composer req symfony/panther

composer req --dev symfony/panther

```

**Warning:** On \*nix systems, the `unzip` command must be installed or you will encounter an error similar to `RuntimeException: sh: 1: exec: /app/vendor/symfony/panther/src/ProcessManager/../../chromedriver-bin/chromedriver_linux64: Permission denied` (or `chromedriver_linux64: not found`). The underlying reason is that PHP's `ZipArchive` doesn't preserve UNIX executable permissions.

### Basic Usage

[](#basic-usage)

```
