#
import re

import requests
import tls_client

session = tls_client.Session(client_identifier='chrome_117',
                             header_order=['Host', 'content-type', 'accept', 'accept-language', 'authority',
                                           'cache-control', 'pragma', 'sec-ch-ua', 'sec-ch-ua-mobile',
                                           'sec-ch-ua-platform', 'sec-fetch-dest', 'sec-fetch-mode', 'sec-fetch-site',
                                           'sec-fetch-user', 'upgrade-insecure-requests', 'user-agent']
                             )
# px = 'http://127.0.0.1:7890'
# session.proxies = {
#     'http': px,
#     'https': px,
# }
# session.proxies = {
#     'http': "http://user-uni007-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
#     'https': "http://user-uni007-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
# }
session.proxies = {
    'http': 'http://127.0.0.1:8890',
    'https': 'http://127.0.0.1:8890',
}
# session.proxies = {
#     'http': 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000',
#     'https': 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000',
# }
#
# session.proxies = {
#     'http': 'http://uni00001_custom_zone_US_sid_67336724_time_5:q39CEBTs5A@us.foxyip.com:7778',
#     'https': 'http://uni00001_custom_zone_US_sid_67336724_time_5:q39CEBTs5A@us.foxyip.com:7778',
# }
# headers = {"Host": "makeabooking.flyscoot.com", "upgrade-insecure-requests": "1", "cache-control": "no-cache", "pragma": "no-cache", "sec-ch-ua": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"", "sec-fetch-site": "none", "sec-fetch-user": "?1", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36", "cookie": "reese84=3:VJ820WHhjme3/crOQaj78A==:eFJPEYy8XcYEaP/atv9fsT5D7ToFdNFTxaa4bwmR90dilu33beyKbfCyJnkdhT9e+5l8jAJb01h63pqt05MhGg9r/5RZejtnfIJAECMnRb6Zz7BEkeLZHIV2vSo0tb0/li9KV0/pG2fQ2hPC4Bf70WMmyNgXLCNy6+xR/VTTLuisf27xMI4qQqlwJOL4ceXIKRg9TJESeDrKT3lq+uTN/nHd5m7bMSe1jU2P7blcGFw3lCBoz9edfjoSXd2/7TxU4XcRvSz0heQxlH5afjWXEN9O/ZdR5HvbXvj8R534nWEpIlsMSF4LFm+ZtDChW+DaIXYCrON88ZAjtRRoGJD+m10v7dwIhz8GE7jqSX6w+COBRVuUw+TolSElhniGECx9ecxrDXK4lenXEBbti9c6qsUW0aDucOXJ7RuH846Cv/wHzWgxDdXfq8d48wUkWiG/CUQcWwjYUB5yQxjS+PZBHw==:199JVZOOdh33meA+GDcpO7MgGYmM8lFo8rd89zsD8XI=; incap_ses_1162_2444946=tHIUBxd4eUOf2aNY70EgEHjtb2UAAAAAV4E0WPMRva8MqaB4iKuE1g==; nlbi_2444946_2147483392=bCBsA6JgUAtev9ZQbmwDOgAAAACEAf4Pzyd7zDA/Owdy7p7I; visid_incap_2444946=yoawIYrdRCqTlkmmJjaoKHjtb2UAAAAAQUIPAAAAAADcMmrcTzpY1NPbHZffXyVR", "authority": "makeabooking.flyscoot.com", "sec-ch-ua-platform": "\"macOS\"", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "accept-language": "en-US,en;q=0.9", "sec-ch-ua-mobile": "?0"}

import requests


headers = {
    "authority": "www.transavia.com",
    "accept": "*/*",
    "accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
    "cache-control": "no-cache",
    "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
    "origin": "https://www.transavia.com",
    "pragma": "no-cache",
    "referer": "https://www.transavia.com/en-EU/book-a-flight/flights/search/",
    "request-context": "appId=cid-v1:942f733a-0e08-45b5-a6e2-53089f65a4b2",
    "request-id": "|a04dfb745be3461c962b99a7951153cb.6d3b0d19cc6e4798",
    "sec-ch-ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "traceparent": "00-a04dfb745be3461c962b99a7951153cb-6d3b0d19cc6e4798-01",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "x-requested-with": "XMLHttpRequest"
}
cookies = {
    "visid_incap_2445686": "uQbQ4nwWQReh8pInxEUZCrHzCGcAAAAAQUIPAAAAAABHXVHTlGBzzLneKY3BjAya",
    "nlbi_2445686": "XckUJJ+b0Aq0HMbqUVmepAAAAABB6+BbrZZErPRrn5mqSISY",
    "optimizelyEndUserId": "oeu1728640010256r0.7887305092134937",
    "ai_user": "GycvSxWM5jcGDplsxCw+Do|2024-10-11T09:46:50.423Z",
    "nlbi_2897631": "vg88GsAt/mVOy8vMJWK71gAAAABC89H3YN8YoZq7w76pcFUc",
    "visid_incap_2897631": "ErHrOr+0Tba6VHxG7UFPjgv0CGcAAAAAQUIPAAAAAADmwDuiQ9QH2NBIgggsBWVG",
    "tmDeviceId": "844b3725-deaa-44bf-bfe2-e6dcf13e05b8",
    "tmId": "7cdd4fa2-0801-452b-91d8-4832cd1a340b",
    "tra_ga": "GA1.1.844b3725-deaa-44bf-bfe2-e6dcf13e05b8",
    "cookies_accepted": "true",
    "tmConsentLocal": "1|preferences-true|statistics-true|marketing-true",
    "_gcl_au": "1.1.551802351.1728640640",
    "tmConsent": "1|preferences-true|statistics-true|marketing-true",
    "_fbp": "fb.1.1728640642775.16580402672313013",
    "sp": "7d0ff090-efda-48c5-ab91-5adc456d8925",
    "websiteuk#lang": "en",
    "ASP.NET_SessionId": "sua5qir5qpls3plnwm130yk2",
    "SC_ANALYTICS_GLOBAL_COOKIE": "3e9f99bc5b3a48999b5f18d37eb31656|False",
    "__RequestVerificationToken": "EUXkxDg7p5iySkazF5IYUZjYBfPo3c4pE_WJNHmjpFqJVJWdks8VBQguC7IGjPoricI9HudxBGVvF-7swtpXxpmTZuaHaXQYj0DAe2xz5l01",
    "TransaviaFlightSearch": "%7B%22flyingBlue%22%3Afalse%2C%22flightType%22%3A%22one-way%22%2C%22passengers%22%3A%7B%22isValid%22%3Atrue%2C%22adults%22%3A1%2C%22children%22%3A0%2C%22infants%22%3A0%7D%2C%22route%22%3A%7B%22validRoute%22%3Atrue%2C%22departure%22%3A%22EDI%22%2C%22arrival%22%3A%22ORY%22%2C%22isKlm%22%3Afalse%2C%22isDohop%22%3Afalse%7D%2C%22dates%22%3A%7B%22from%22%3A%222024-11-01%22%7D%2C%22secondRoute%22%3A%7B%22validRoute%22%3Afalse%2C%22departure%22%3Anull%2C%22arrival%22%3Anull%7D%2C%22secondDates%22%3A%7B%22from%22%3Anull%7D%7D",
    "_clck": "12omyhe%7C2%7Cfpy%7C0%7C1745",
    "websitenl#lang": "en",
    "incap_ses_1204_2445686": "W/BiJQoSNEg/saefsXe1EMPlCWcAAAAAZgfjFnBI7iOLKghXwl4Ozg==",
    "SearchSite.SiteLang": "en-nl",
    "incap_ses_1204_2897631": "6gTnUjIT2275saefsXe1EMXlCWcAAAAA0pwwS3DF9n0/i/lUwi65wQ==",
    "df_vs": "1",
    "df_ss": "1728701897039",
    "spses.a620": "*",
    "_pin_unauth": "dWlkPU9XTmtZVEE0WVRBdE1HTTRPQzAwTTJNMkxUaGxZV1F0TVRKbFl6QXlOMkZoWXpRNQ",
    "nlbi_2445686_2147483392": "A5BZSwksgH7zNbDOUVmepAAAAADi0v1CzK6zHfS+yiAQp1KN",
    "reese84": "3:AjC3hDAZpYLJi+P7Ql1zrg==:hk+2fY+5IHXAz3DSrmdsUfn6zIpIu3jmxQ99O2TkpDR+4LZV47J/Bqvid47tBGw1AQvsaPVbzyggbIz3qy1Om4FTeDA4Ew/q6jECQJVzaBtRdFbSAx/CorbtQUYs4ziqu0xC3b3G1/PTWCJxWJAZfqeHTGgXO4tgG0kR7W0rQPUoEJhj1UuZ79VtQSwI0MIil12rvg5E+SbHooFb1fRIb6BH9J1v1O/Qdq7CmsfPnkF4kNbVoPZEvI2/nv5xB32Gq5a5vUegxeuv5UCe57X7dDgVL8aOhqLSm96zpLDbxCjuCOPMvj2WvyP/doMVgLSLoG+lwJZ9JSVawT+KQa8ZiJRs/OIAJASLqdeXiO6M2CsUJhs2LFz1T3Mz/Syg6W9KIPUPFi2l7dRCgj0AzECplLMb/hLw3BWFpWj81RL/6B5nV56ZudWJoNrO0sjHqKrexD1cdZyvzbx8ZSF8q6E4DsozaWVr/4L5WPPhowdVthPRiaDEQootrMykIpW2X02s:LxFICMmFtLqKP2Zf9G4h7jMVrggRn/vSKfv2MQa0eqU=",
    "websiteeu#lang": "en",
    "sitelang": "/en-EU/",
    "ai_session": "fhtQFkWie3JoTJ2+g8BaPQ|1728701888073|1728701986728",
    "df_bpln": "5",
    "spid.a620": "05446688-be43-4e46-aa2f-bad3e065ef7e.1728640642.2.1728701989.1728640711.a3998d3f-dc54-445c-b76d-dea18541f4e0.7a568abe-9c05-4e02-a9aa-7266d5b55fa6.0e48c653-c7eb-4813-8f92-c968d04c7bb9.1728701899976.5",
    "_rdt_uuid": "1728640641617.9c1b249a-082f-40ef-ab21-806f03f0472f",
    "_uetsid": "369c07b087b711ef90b8c7e8dd906904",
    "_uetvid": "369c2dc087b711ef8459795618f69d07",
    "tra_ga_21Q6T8Z90B": "GS1.1.1728701891.2.1.1728701988.0.0.236176711",
    "_cdi2_id": "aeb28017-526e-4f08-ace2-eefe382a0700.1728640642.1728701989",
    "_cdi2_id_s": "aeb28017-526e-4f08-ace2-eefe382a0700.1728640642.1728701989",
    "_clsk": "z22bbk%7C1728701989626%7C5%7C0%7Cl.clarity.ms%2Fcollect"
}
url = "https://www.transavia.com/en-EU/book-a-flight/flights/multidayavailability/"
data = {
    "selectPassengersCount.AdultCount": "1",
    "selectPassengersCount.ChildCount": "0",
    "selectPassengersCount.InfantCount": "0",
    "routeSelection.DepartureStation": "AHU",
    "routeSelection.ArrivalStation": "RTM",
    "dateSelection.OutboundDate.Day": "13",
    "dateSelection.OutboundDate.Month": "10",
    "dateSelection.OutboundDate.Year": "2024",
    "dateSelection.InboundDate.Day": "",
    "dateSelection.InboundDate.Month": "",
    "dateSelection.InboundDate.Year": "",
    "dateSelection.IsReturnFlight": "false",
    "flyingBlueSearch.FlyingBlueSearch": "false",
    "__RequestVerificationToken": "Dj8esViFlayzpKVv_NFy1nOuQk4cpqg0HDRPn5qa92Lp5_15XnpI1wfNYk0PbfZjngQ90b_0RyRCiZ8L54C5hI1PmT9c0Zz32uje45TYjZI1"
}
response = session.post(url, headers=headers, cookies=cookies, data=data)

print(response.text)
print(response)