#
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 = {
    "Host": "www.transavia.com",
    "pragma": "no-cache",
    "cache-control": "no-cache",
    "sec-ch-ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"",
    "request-context": "appId=cid-v1:942f733a-0e08-45b5-a6e2-53089f65a4b2",
    "traceparent": "00-6fd38f0e1c05475cbcccc9237103701d-aeeb8b0612ca4459-01",
    "sec-ch-ua-mobile": "?0",
    "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",
    "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
    "accept": "*/*",
    "x-requested-with": "XMLHttpRequest",
    "request-id": "|6fd38f0e1c05475cbcccc9237103701d.aeeb8b0612ca4459",
    "sec-ch-ua-platform": "\"macOS\"",
    "origin": "https://www.transavia.com",
    "sec-fetch-site": "same-origin",
    "sec-fetch-mode": "cors",
    "sec-fetch-dest": "empty",
    "referer": "https://www.transavia.com/en-UK/book-a-flight/flights/search/",
    "accept-language": "en,en-US;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6"
}
cookies = {
    "visid_incap_2445686": "huMlpQlyQJuemtwiyyN1VD3hBWcAAAAAQUIPAAAAAABfaCn8b3c92cqBkO4125eY",
    "cookies_accepted": "true",
    "tmConsentLocal": "1|preferences-true|statistics-true|marketing-true",
    "_gcl_au": "1.1.1869918835.1728438589",
    "nlbi_2445686": "aPZJKQHy2DmRKNe/UVmepAAAAAACmiSBjp8td25ZyCrKY71c",
    "websiteuk#lang": "en",
    "ASP.NET_SessionId": "d0bjok4tg4bh0raisxizjwvj",
    "sitelang": "/en-UK/",
    "SC_ANALYTICS_GLOBAL_COOKIE": "e0a52ec1c10048a3bc163754840e27b0|False",
    "__RequestVerificationToken": "6UDOzTFWk9GR0nWaFJe_YWFvhxvuRLUQ914fKkk6pfqAc8IXIDJz46chV7_-aLWTedWAK6amHLFAZH0NCgZoH_JjUsKdDsq75T8DklXChQc1",
    "optimizelyEndUserId": "oeu1728438590882r0.561515830738017",
    "ai_user": "a1m2PdIyVltybx6JNMhsE+|2024-10-09T01:49:50.969Z",
    "tmDeviceId": "57d36a76-caf8-4e35-8275-7c16e2dd28be",
    "tmId": "55e88134-e382-401c-a245-8804016f77b3",
    "tra_ga": "GA1.1.57d36a76-caf8-4e35-8275-7c16e2dd28be",
    "tmConsent": "1|preferences-true|statistics-true|marketing-true",
    "_fbp": "fb.1.1728438593664.1607416950",
    "visid_incap_2897631": "+PyW9ZfrTRKhgjo+Ov9MIkDhBWcAAAAAQUIPAAAAAADCcz+0piEnkpEExpQmRkq9",
    "nlbi_2897631": "PcQhTZ8Z7m4KAjwzJWK71gAAAADzxYallNzSis6WUvkhqXMo",
    "sp": "e07525ac-64c4-4091-b090-49b959fbd7f3",
    "incap_ses_1787_2445686": "UYONFPNAEAwft3ZQMrPMGGnxBWcAAAAAeSWRdrkVxWWu+rGs9cRNow==",
    "incap_ses_1787_2897631": "GduVJH6FnhakT5lQMrPMGO32BWcAAAAA2Kn2pODBXIS9Ed3pvGL7fQ==",
    "incap_ses_1204_2445686": "6r7RRpW/BiaYftiesXe1EEeBCGcAAAAA6C6rhYSjOllzhB16VRubTg==",
    "SearchSite.SiteLang": "en-uk",
    "reese84": "3:UwWwAA+FjAuSbj44jGi5mw==:oFs2KsxqeNPBb/xSDCjLCOgI+OtPapOeeqMqycricPLEUInftVW2DMBGWe+bY1OehPbpy49PUAmFSvoruCH6fp/yEnQImgVssGxdvJ3Y7sqTWJmKnl2jBXQsQ4G75Zd8yi3R72AVkmw1sS3yRXkt15SQoVPDc2y4IyZjjYoAjJT6b/YOuRqOOCzZGkGykCWQN+qRdiFL2ZdKxU8W5yNVPoB4YDsl1rhRGePkbpzkj52fAWrkipz5r9ledXvELRfsvKRIk81CTF36MGbdhjwW9pZjFAac+eZ3/OXcBBwaD9ub1jbCiXIf2Fz8UfH0Su+DnT/HwHRBXXpav/bJvlXKeaW7/fouKkGVW5wxklxvBRGxW62kQbi4w47gzaeqPAdeoQlRf9VxNjuu47Q5H7MZCcqZQCfk0UNtT7GPQ5+Xx7s+ej0SvgVvU0uJHlqsoMZSW24C/sW5Lx03LpQjGgRiW/HypeytZgkteTDWxHNJZ1ZMcluYLIh+eCRm50P9TUg0Ud+QzNW65OFGJkYAiC/bww==:ZRRVoD2H5SlSTufVpjn9GmyT1lerjdeizHXTNyOzciI=",
    "incap_ses_1204_2897631": "rDOkH98o1GmwgtiesXe1EE+BCGcAAAAABqdiqMWuIQknWeAiJDvfoA==",
    "df_vs": "1",
    "df_ss": "1728610640693",
    "spses.a620": "*",
    "_clck": "yn5soy%7C2%7Cfpx%7C0%7C1743",
    "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-10-14%22%2C%22to%22%3Anull%7D%2C%22secondRoute%22%3A%7B%22validRoute%22%3Afalse%2C%22departure%22%3Anull%2C%22arrival%22%3Anull%7D%2C%22secondDates%22%3Anull%7D",
    "nlbi_2445686_2147483392": "6cBdHVRar1EnkvunUVmepAAAAACg8hTaNpeoG25AWXq9gl8P",
    "df_bpln": "2",
    "_rdt_uuid": "1728438591330.76c6d1eb-7721-43b3-a8ea-05890f05f612",
    "spid.a620": "b53a824e-a2ca-4512-acec-14c41236e9ad.1728438591.2.1728610659.1728438598.e83f758f-a359-4a7a-a648-b019ad3031ce.618636e7-7105-4469-be19-d11c36806d03.920f5f3b-867d-4aac-8777-999cc60a7b03.1728610641333.3",
    "tra_ga_21Q6T8Z90B": "GS1.1.1728610642.3.1.1728610659.0.0.1941883218",
    "_cdi2_id": "2f95bdb4-882a-4418-89aa-143ee02af0a4.1721902360.1728610660",
    "_cdi2_id_s": "2f95bdb4-882a-4418-89aa-143ee02af0a4.1721902360.1728610660",
    "_uetsid": "5c094d40877111ef8fa167e4f44905d3",
    "_uetvid": "a86014104afc11efbee417e6e3f172c4",
    "_clsk": "vhczss%7C1728610661886%7C2%7C0%7Cl.clarity.ms%2Fcollect",
    "ai_session": "WRg1cr4iyRxQYpNuzvZgS3|1728610636775|1728610982114"
}
url = "https://www.transavia.com/en-UK/book-a-flight/flights/SingleDayAvailability/"
data = {
    "selectSingleDayAvailability.JourneyType": "OutboundFlight",
    "selectSingleDayAvailability.Date.DateToParse": "2024-10-13",
    "selectSingleDayAvailability.AutoSelect": "false",
    "__RequestVerificationToken": "dTErC46IeiaVgjxfci6zjLQ5mfbk0XZIFGbnqCTcpyxNEC7N0foribUWCGPwilj2O3mDZf7pF5ytS_es0vB5R0wk1pu_JzMe_rEmVvg6AxU1"
}
response = session.post(url, headers=headers, cookies=cookies, data=data)

print(response.text)
print(response)