Answer the question
In order to leave comments, you need to log in
How to parse prices in the issuance of air tickets?
Good day!
There was a task - to parse the prices for air tickets using php. Algorithm:
1. On my website, the client enters the number of people, date, direction
2. There should be a parsing of airfare prices from the butaairways.az website
3. The resulting price should be added to the cost of the tour
By the very parsing as such using curl - there are a lot of materials . But I could not find anything regarding parsing of search results (not counting Yandex and Google, where the get request is visible). Who will tell you what direction to go?
Answer the question
In order to leave comments, you need to log in
But I couldn't find anything regarding SERP parsingSearch results from where? From a donor site? See how the request to the search system occurs, most likely, parameters are also passed to the get request, but it is possible that post requests are sent, all this can be seen in the network tab in the developer tools in any modern browser.
This is shit on the first angular, so parsing with a curl will not work, you need to use https://github.com/nesk/puphpeteer
Or pull their api:
1. We get a session, it must be taken before each request
2. We take sessionId and pull further
curl 'https://booking.butaairways.az/ws/flights/weekFlights' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://booking.butaairways.az/' -H 'Origin: https://booking.butaairways.az' -H 'Accept-Language: ru' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36' -H 'Sec-Fetch-Mode: cors' -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"from":"VKO","to":"UFA","departureDate":"2019-09-24","travelersInfos":[{"code":"ADT","quantity":"1"},{"code":"CNN","quantity":"0"},{"code":"INF","quantity":"0"}],"returnDate":"2019-09-24","rt":true,"sessionId":"<Сессия>"}' --compressed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question