Answer the question
In order to leave comments, you need to log in
How to parse Yandex Taxi?
<?php
require_once 'curl-master/curl.php';
require_once 'phpquery-master/phpQuery/phpQuery.php';
include_once('simple_html_dom.php');
function request($url){
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0');
curl_setopt ($ch, CURLOPT_COOKIEJAR, realpath("cookie.txt"));
curl_setopt ($ch, CURLOPT_COOKIEFILE, realpath("cookie.txt"));
$token='fc99295daf6e769fd71ab184ce12eb27';
$repat='https://lk.taximeter.yandex.ru/account';
//$repat='https://lk.taximeter.yandex.ru/list/balance';
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER,false);
$postdata='real_retpath=https://lk.taximeter.yandex.ru&from=&fretpath=&clean=&idkey=f74fec8e6ce082bdb24eac48452fdeba20&extended=1&csrf_token='.$token.'&one=1&retpath='.$repat.'&[email protected]&passwd=qweasdzxc123&twoweeks=no';
if($postdata){curl_setopt ($ch, CURLOPT_POSTFIELDS,$postdata);}
$html=curl_exec($ch);
curl_close($ch);
echo $html;
}
file_put_contents('cookie.txt','');
$html=request('https://passport.yandex.ru/auth?retpath=https://lk.taximeter.yandex.ru');
?>
Answer the question
In order to leave comments, you need to log in
https://yandex.ru/legal/taxi_termsofuse/api.taxionline.com/docs/api.html
_
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question