D
D
Denis2018-01-07 18:24:10
PHP
Denis, 2018-01-07 18:24:10

How to integrate cookies created via JS into CURL PHP?

Hello. The problem is the following. I tried to parse one large site (using curl and php), but how it turned out to be protected from parsing, which is as follows. When you first open the site page, cookies are set in the browser through JS, which are subsequently checked for availability. Accordingly, if they are not there, then JS did not work, then the page is requested by the robot.
I tried to look for these cookies in the site code, but it did not help, even when I found them there and sent them along with the headers, the server still fired me. This means that somewhere else cookies are being set that I did not find.
Of course, there is a file for saving and reading cookies via CURL, but in principle this is not so important, since it is client cookies that are checked. (I mean the flags in curl_setopt CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE).
I read an article about it ( here ) but it did not help me, because the author quickly found the cookie that the server was checking, but I can't find it.
Please advise how you can track the process of creating cookies through JS.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-01-07
@dimonchik2013

start with Chrome + F12
only, if you're not running JS, where does the cookie come from?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question