S
S
Sergey Prisyazhnyuk2017-09-29 15:54:51
PHP
Sergey Prisyazhnyuk, 2017-09-29 15:54:51

How to parse Yandex Taxi?

59ce42bf0d009472862806.png

<?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');




?>

the question is how to get a token from Yandex?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-09-29
@webinar

https://yandex.ru/legal/taxi_termsofuse/api.taxionline.com/docs/api.html
_

K
koreets61, 2017-12-05
@koreets61

The token is generated there every time you visit the site, and each of its pages.
I can help you. Write to [email protected]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question