A browser testing and web scraping library for PHP and Symfony. Panther is a convenient standalone library to scrape websites and to run end-to-end tests using real browsers.
Questions tagged [symfony-panther]
56 questions
8
votes
2 answers
How can i set proxy server with symfony/panther
I found two way of setting proxy server one is through chrome web driver capabilities and the other one is directly setting while creating chrome client
$this->client = Client::createChromeClient(null, [
…

ahmed waleed
- 477
- 1
- 4
- 12
6
votes
2 answers
Headless Google Chrome: How to prevent sites to know whether their window is focused or not
Is there a way to prevent sites to know if they are visible or not?
Perhaps a command line flag? I checked here but I could not find anything suitable https://peter.sh/experiments/chromium-command-line-switches/.
I think they use the page visibility…

Wes
- 3,978
- 4
- 24
- 45
5
votes
2 answers
Webscraping Symfony/Panther: Can't get HTML
I want to scrape a site with the symfony panther package within a Laravel application. According to the documentation https://github.com/symfony/panther#a-polymorphic-feline I cannot use the HttpBrowser nor the HttpClient classes because they do not…

Danaq
- 633
- 1
- 6
- 18
4
votes
1 answer
Symfony crawler select OPTION in SELECT list without FORM
I am crawling a website that has a SELECT that are freestanding with no FORM parent and no NAME, only ID.

Thomas
- 43
- 5
3
votes
1 answer
Symfony panther issue
I am using Symfony Panther for web scraping. When Google Chrome's version and Chrome driver was 89, everything worked fine. But after updating both versions to 92,
$crawler->filter('h1')->html();
will always return empty string.
I think, the…

Vlad Ginosyan
- 31
- 2
3
votes
1 answer
Change user-agent for Symfony Panther Chromeclient
How do I change the user-agent in a headless Chrome created by Symfony's Panther createChromeClient()?
When I create a Chrome client with
$client = \Symfony\Component\Panther\Client::createChromeClient();
I see in the access_log a user-agent of…

Oliver Hörold
- 317
- 4
- 13
3
votes
0 answers
Symfony Panther - Rollback db transaction in functional test
I want to rollback all queries made inside the symfony/panther test.
With the normal WebTestCase i can achieve that by
protected function setUp()
{
parent::setUp();
$this->client = static::createClient();
$this->client->disableReboot();
…

AnC
- 641
- 4
- 16
3
votes
1 answer
How to get the container with panther
Im trying to get the container in my testcase.
$client = self::createPantherClient()->getContainer()
&
Error : Call to undefined method Symfony\Component\Panther\Client::getContainer()
So how do you get the container within a Panther test client?

Martin-
- 876
- 2
- 13
- 30
2
votes
1 answer
"Facebook \ WebDriver \ Exception \ TimeoutException" when using waitFor() in symfony/panther & Laravel
I have a laravel app that is using symfony/panther to scrape js loaded web pages.
Upon running, I always get a timeout exception Facebook \ WebDriver \ Exception \ TimeoutException at the waitFor() method.
I've tried increasing the…

xslibx
- 4,249
- 9
- 35
- 52
2
votes
0 answers
BrowserStrack integration with Panther for E2E Tests
Does anyone has tried to integrate BrowserStack cloud solution into Panther ?
We use Panther (Chrome) for our E2E tests on our Github actions but most of our customers use Internet Explorer :( so we want to test with IE instead.
Panther does not…

Glyph
- 23
- 3
2
votes
2 answers
getHeader from getInternalResponse in Symfony Panther always return an empty array
By using Symfony Panther, I sent a request and I wanted to get the response. I was able to get the body and the status code but for the header I just got an empty array.
$client = Client::createChromeClient();
$client->request('GET',…

gholam montazery
- 21
- 2
2
votes
2 answers
Set up one instance of ChromeDriver for Panther, rather than creating one for each request
I am using Symfony Panther for web scraping (not testing) in a PHP project that does not use Symfony. I installed via Composer. Each time I need to scrape a link submitted by a user, I start a new Chrome Browser.
$client =…

Cogicero
- 1,514
- 2
- 17
- 36
2
votes
1 answer
Symfony & Panther : Panther does'nt load - can't createPantherClient()
I have an issue with Panther in a Symfony 4.4 project.
The project has LiipFunctionnalTestBundle on it, but for testing JS as well, I wanted to have Panther.
I've installed Panther, in my composer I've "symfony/panther": "^0.8.0" and I can extend my…

Plinolita
- 21
- 1
2
votes
0 answers
How to login with Panther on an external website?
I use symfony/panther for web crawling. To access the page I want, I need to be authenticated and I don't know how to do it.
I have tried :
$client = Client::createChromeClient();
$client->start();
$crawler = $client->request('GET',…

BanjoSf4
- 149
- 1
- 1
- 13
2
votes
0 answers
Symfony Panther && Docker (Alpine) chrome keeps crashing
Recently I've decided to check out the Symfony Panther HTTP Client. I thought it would be nice to integrate that for testing and things.
I did follow the documentation very carefully. I have registered its extension for PHP unit. I can create a…

Robert
- 1,206
- 1
- 17
- 33