Hello, how can I parse the information from this site (authorized) cp.wowcircle.com (login: afasfafs, pass: afasfafs for the test) using php and is it even possible?

<?php // САЙТ $url = 'http://cp.wowcircle.com/direct.php'; // НАЧАЛО $ch = curl_init($url); // ПОДГОТОВКА ЗАГОЛОВКОВ $uagent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36"; // ВСЯКИЕ ПАРАМЕТРЫ curl_setopt($ch, CURLOPT_USERAGENT, $uagent); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // ДОБАВЛЯЕМ КУКИ В ПАРАМЕТРЫ curl_setopt($ch, CURLOPT_COOKIE, "PMBC=96152e8e9a0168a731539c5e52c6b39a; PHPSESSID=jl0i13pn3157qca807jgp0jqa7; ServerName=WoW+Circle+3.3.5a+x5; serverId=1"); $html = curl_exec($ch); // КОНЕЦ curl_close($ch); var_dump($html); 

The code works, but there is a problem how to send a request of this kind: Request Payload:

 {"action":"wow_Services","method":"cmdLogin","data":[{"accountName":"dsa","password":"dadad","captcha":"ADASDAD"}],"type":"rpc","tid":3} 

And is it possible to somehow parse a captcha with http://cp.wowcircle.com/ and substitute it in the same request?

  • The robot can not lie, so it can not pass this captcha :) And in general - everything that you can do in the browser, everything can be done with code. - KoVadim

1 answer 1

The request can be transferred by adding lines:

 curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); 

With kapchey I will not advise anything.

  • Can you help write the request itself, I just don’t quite understand the json nesting? - user220283
  • $payload = '{"action":"wow_Services","method":"cmdLogin","data":[{"accountName":"dsa","password":"dadad","captcha":"ADASDAD"}],"type":"rpc","tid":3}'; - iosp
  • Added, the result has not changed, no errors, nothing - user220283
  • Try adding: curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); and change CURLOPT_FOLLOWLOCATION `true` - iosp