How do I make Symfony 2 Crawler accept cookies?

I am working on a crawler to crawl a website with a listing. I finished scanning and scraping, but I ended up in a road block.

The pagination on this website is cookie (or session) based, so I have to force my crawler to accept any cookies the website sets (submissions) and behave like a browser on further requests.

I am new to symphony and I cannot find a source explaining this clearly.

I found the following links while trying to find a solution. But they're not exactly what I'm looking for.

http://www.webtipblog.com/creating-a-crawler-in-symfony-2-using-the-domcrawler-and-client/

http://symfony.com/doc/current/cookbook/testing/simulating_authentication.html

Can anyone tell me how can I do this?

Many thanks.

+3
php cookies symfony


source to share


No one has answered this question yet

Check out similar questions:

2776
How can I prevent SQL injection in PHP?
2664
How can I check if a string contains a specific word?
2263
How to get YouTube video thumbnail using YouTube API?
1201
How do I set / remove a cookie using jQuery?
1192
How do I redirect in PHP?
867
How do I end PHP session after 30 minutes?
863
Local storage versus cookies
451
Set cookie and get cookie with JavaScript.
0
PHP - see the cookies used by the website
-1
Clear Website Data USAGE Symfony DomCrawler Component



All Articles
Loading...
X
Show
Funny
Dev
Pics